NIFPGA.Interop.cs 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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.Text;
  7. using System.Threading.Tasks;
  8. using FxpConvert.Common;
  9. namespace NIFPGA
  10. {
  11. partial class Interop
  12. {
  13. public enum NiFpga_FifoProperty
  14. {
  15. /// NiFpga_FifoProperty_BytesPerElement -> 1
  16. NiFpga_FifoProperty_BytesPerElement = 1,
  17. /// NiFpga_FifoProperty_HostBufferAllocationGranularity -> 2
  18. NiFpga_FifoProperty_HostBufferAllocationGranularity = 2,
  19. /// NiFpga_FifoProperty_HostBufferSize -> 3
  20. NiFpga_FifoProperty_HostBufferSize = 3,
  21. /// NiFpga_FifoProperty_HostBufferMirrorSize -> 4
  22. NiFpga_FifoProperty_HostBufferMirrorSize = 4,
  23. /// NiFpga_FifoProperty_HostBufferType -> 5
  24. NiFpga_FifoProperty_HostBufferType = 5,
  25. /// NiFpga_FifoProperty_HostBuffer -> 6
  26. NiFpga_FifoProperty_HostBuffer = 6,
  27. /// NiFpga_FifoProperty_FlowControl -> 7
  28. NiFpga_FifoProperty_FlowControl = 7,
  29. /// NiFpga_FifoProperty_ElementsCurrentlyAcquired -> 8
  30. NiFpga_FifoProperty_ElementsCurrentlyAcquired = 8,
  31. }
  32. public enum NiFpga_CloseAttribute
  33. {
  34. /// NiFpga_CloseAttribute_NoResetIfLastSession -> 1
  35. NiFpga_CloseAttribute_NoResetIfLastSession = 1,
  36. }
  37. public enum NiFpga_RunAttribute
  38. {
  39. NiFpga_RunAttribute_None=0,
  40. /// NiFpga_RunAttribute_WaitUntilDone -> 1
  41. NiFpga_RunAttribute_WaitUntilDone = 1,
  42. }
  43. public static Boolean NiFpga_IsError(NiFpga_Status status) => status < NiFpga_Status.Success;
  44. public static Boolean NiFpga_IsNotError(NiFpga_Status status) => status >= NiFpga_Status.Success;
  45. public static float NiFpga_CalculateFxpDeltaFloat(NiFpga_FxpTypeInfo typeInfo)
  46. {
  47. int exponent = typeInfo.integerWordLength - typeInfo.wordLength;
  48. return (float)ldexp(FLT_EPSILON, exponent + FLT_MANT_DIG - 1);
  49. }
  50. public static double NiFpga_CalculateFxpDeltaDouble(NiFpga_FxpTypeInfo typeInfo)
  51. {
  52. int exponent = typeInfo.integerWordLength - typeInfo.wordLength;
  53. return ldexp(DBL_EPSILON, exponent + DBL_MANT_DIG - 1);
  54. }
  55. public static float NiFpga_ConvertFromFxpToFloat(NiFpga_FxpTypeInfo typeInfo,ulong data)
  56. {
  57. float delta = NiFpga_CalculateFxpDeltaFloat(typeInfo);
  58. return (float)NiFpga_Private_FxpToFloatingPoint(typeInfo, delta, data);
  59. }
  60. public static double NiFpga_ConvertFromFxpToDouble(NiFpga_FxpTypeInfo typeInfo, ulong data)
  61. {
  62. double delta = NiFpga_CalculateFxpDeltaDouble(typeInfo);
  63. return NiFpga_Private_FxpToFloatingPoint(typeInfo, delta, data);
  64. }
  65. static double NiFpga_Private_FxpToFloatingPoint(NiFpga_FxpTypeInfo typeInfo,double delta,ulong data)
  66. {
  67. ulong wordLengthMask = (1UL << typeInfo.wordLength) -1;
  68. data &= wordLengthMask;
  69. if(typeInfo.isSigned)
  70. {
  71. ulong signedMask = 1UL << (typeInfo.wordLength - 1);
  72. if((data& signedMask)!=0)
  73. {
  74. long signedData = (long)(data ^ wordLengthMask);
  75. signedData = (signedData + 1) * -1;
  76. return delta * signedData;
  77. }
  78. }
  79. return delta * data;
  80. }
  81. public static ulong NiFpga_ConvertFromFloatToFxp(NiFpga_FxpTypeInfo typeInfo, float data)
  82. {
  83. float delta = NiFpga_CalculateFxpDeltaFloat(typeInfo);
  84. return NiFpga_Private_FloatingPointToFxp(typeInfo, delta, data);
  85. }
  86. public static ulong NiFpga_ConvertFromDoubleToFxp(NiFpga_FxpTypeInfo typeInfo, double data)
  87. {
  88. double delta = NiFpga_CalculateFxpDeltaDouble(typeInfo);
  89. return NiFpga_Private_FloatingPointToFxp(typeInfo, delta, data);
  90. }
  91. static ulong NiFpga_Private_FloatingPointToFxp(NiFpga_FxpTypeInfo typeInfo, double delta, double data)
  92. {
  93. ulong wordLengthMask = (1UL << typeInfo.wordLength) - 1;
  94. if (data < 0)
  95. {
  96. if (typeInfo.isSigned)
  97. {
  98. long fxpRepresentation = (long)(data / delta);
  99. fxpRepresentation ^= (long)wordLengthMask;
  100. fxpRepresentation += 1;
  101. fxpRepresentation *= -1;
  102. if ((long)(fxpRepresentation & (long)wordLengthMask) == fxpRepresentation)
  103. {
  104. return (ulong)fxpRepresentation;
  105. }
  106. else /* minimum */
  107. {
  108. return (ulong)(-1L * (1L << (typeInfo.wordLength - 1)))& wordLengthMask;
  109. }
  110. }
  111. else
  112. {
  113. return 0;
  114. }
  115. }
  116. else
  117. {
  118. ulong fxpRepresentation = (ulong)(data / delta);
  119. if ((fxpRepresentation & wordLengthMask) == fxpRepresentation)
  120. {
  121. return fxpRepresentation;
  122. }
  123. else /* maxmimum */
  124. {
  125. byte magnitude = (byte)(typeInfo.wordLength - (typeInfo.isSigned? 1 : 0));
  126. return (ulong)(1 << magnitude) - 1;
  127. }
  128. }
  129. }
  130. const int DBL_MANT_DIG = 53;
  131. const double DBL_EPSILON = 2.2204460492503131e-016;
  132. const long DBL_EXP_MASK = 0x7ff0000000000000L;
  133. const int DBL_MANT_BITS = 52;
  134. const long DBL_MANT_MASK = 0x000fffffffffffffL;
  135. const long DBL_SGN_MASK = -1 - 0x7fffffffffffffffL;
  136. const long DBL_EXP_CLR_MASK = DBL_SGN_MASK | DBL_MANT_MASK;
  137. const float FLT_EPSILON =1.192092896e-07F;
  138. const int FLT_MANT_DIG = 24;
  139. public static double ldexp(double number, long exponent)
  140. {
  141. long bits = System.BitConverter.DoubleToInt64Bits(number);
  142. int exp = (int)((bits & DBL_EXP_MASK) >> DBL_MANT_BITS);
  143. // Check for infinity or NaN.
  144. if (exp == 0x7ff)
  145. return number;
  146. // Check for 0 or subnormal.
  147. if (exp == 0)
  148. {
  149. // Check for 0.
  150. if ((bits & DBL_MANT_MASK) == 0)
  151. return number;
  152. // Subnormal, scale number so that it is in [1, 2).
  153. number *= System.BitConverter.Int64BitsToDouble(0x4350000000000000L); // 2^54
  154. bits = System.BitConverter.DoubleToInt64Bits(number);
  155. exp = (int)((bits & DBL_EXP_MASK) >> DBL_MANT_BITS) - 54;
  156. }
  157. // Check for underflow.
  158. if (exponent < -50000)
  159. return Math.CopySign(0D, number);
  160. // Check for overflow.
  161. if (exponent > 50000 || (long)exp + exponent > 0x7feL)
  162. return Math.CopySign(System.Double.PositiveInfinity, number);
  163. exp += (int)exponent;
  164. // Check for normal.
  165. if (exp > 0)
  166. return System.BitConverter.Int64BitsToDouble((bits & DBL_EXP_CLR_MASK) | ((long)exp << DBL_MANT_BITS));
  167. // Check for underflow.
  168. if (exp <= -54)
  169. return Math.CopySign(0D, number);
  170. // Subnormal.
  171. exp += 54;
  172. number = System.BitConverter.Int64BitsToDouble((bits & DBL_EXP_CLR_MASK) | ((long)exp << DBL_MANT_BITS));
  173. return number * System.BitConverter.Int64BitsToDouble(0x3c90000000000000L); // 2^-54
  174. }
  175. 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);
  176. public delegate NiFpga_Status NiFpgaDll_Finalize();
  177. public delegate NiFpga_Status NiFpgaDll_Close(uint session, NiFpga_CloseAttribute attribute);
  178. public delegate NiFpga_Status NiFpgaDll_Run(uint session, NiFpga_RunAttribute attribute);
  179. public delegate NiFpga_Status NiFpgaDll_Abort(uint session);
  180. public delegate NiFpga_Status NiFpgaDll_Reset(uint session);
  181. public delegate NiFpga_Status NiFpgaDll_Download(uint session);
  182. public delegate NiFpga_Status NiFpgaDll_ReadBool(uint session, uint indicator, ref byte value);
  183. public delegate NiFpga_Status NiFpgaDll_ReadI8(uint session, uint indicator, ref sbyte value);
  184. public delegate NiFpga_Status NiFpgaDll_ReadU8(uint session, uint indicator, ref byte value);
  185. public delegate NiFpga_Status NiFpgaDll_ReadI16(uint session, uint indicator, ref short value);
  186. public delegate NiFpga_Status NiFpgaDll_ReadU16(uint session, uint indicator, ref ushort value);
  187. public delegate NiFpga_Status NiFpgaDll_ReadI32(uint session, uint indicator, ref int value);
  188. public delegate NiFpga_Status NiFpgaDll_ReadU32(uint session, uint indicator, ref uint value);
  189. public delegate NiFpga_Status NiFpgaDll_ReadI64(uint session, uint indicator, ref long value);
  190. public delegate NiFpga_Status NiFpgaDll_ReadU64(uint session, uint indicator, ref ulong value);
  191. public delegate NiFpga_Status NiFpgaDll_ReadSgl(uint session, uint indicator, ref float value);
  192. public delegate NiFpga_Status NiFpgaDll_ReadDbl(uint session, uint indicator, ref double value);
  193. public delegate NiFpga_Status NiFpgaDll_WriteBool(uint session, uint control, byte value);
  194. public delegate NiFpga_Status NiFpgaDll_WriteI8(uint session, uint control, sbyte value);
  195. public delegate NiFpga_Status NiFpgaDll_WriteU8(uint session, uint control, byte value);
  196. public delegate NiFpga_Status NiFpgaDll_WriteI16(uint session, uint control, short value);
  197. public delegate NiFpga_Status NiFpgaDll_WriteU16(uint session, uint control, ushort value);
  198. public delegate NiFpga_Status NiFpgaDll_WriteI32(uint session, uint control, int value);
  199. public delegate NiFpga_Status NiFpgaDll_WriteU32(uint session, uint control, uint value);
  200. public delegate NiFpga_Status NiFpgaDll_WriteI64(uint session, uint control, long value);
  201. public delegate NiFpga_Status NiFpgaDll_WriteU64(uint session, uint control, ulong value);
  202. public delegate NiFpga_Status NiFpgaDll_WriteSgl(uint session, uint control, float value);
  203. public delegate NiFpga_Status NiFpgaDll_WriteDbl(uint session, uint control, double value);
  204. public delegate NiFpga_Status NiFpgaDll_ReadArrayBool(uint session, uint indicator, ref byte array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  205. public delegate NiFpga_Status NiFpgaDll_ReadArrayI8(uint session, uint indicator, ref sbyte array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  206. public delegate NiFpga_Status NiFpgaDll_ReadArrayU8(uint session, uint indicator, ref byte array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  207. public delegate NiFpga_Status NiFpgaDll_ReadArrayI16(uint session, uint indicator, ref short array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  208. public delegate NiFpga_Status NiFpgaDll_ReadArrayU16(uint session, uint indicator, ref ushort array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  209. public delegate NiFpga_Status NiFpgaDll_ReadArrayI32(uint session, uint indicator, ref int array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  210. public delegate NiFpga_Status NiFpgaDll_ReadArrayU32(uint session, uint indicator, ref uint array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  211. public delegate NiFpga_Status NiFpgaDll_ReadArrayI64(uint session, uint indicator, ref long array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  212. public delegate NiFpga_Status NiFpgaDll_ReadArrayU64(uint session, uint indicator, ref ulong array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  213. public delegate NiFpga_Status NiFpgaDll_ReadArraySgl(uint session, uint indicator, ref float array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  214. public delegate NiFpga_Status NiFpgaDll_ReadArrayDbl(uint session, uint indicator, ref double array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  215. public delegate NiFpga_Status NiFpgaDll_WriteArrayBool(uint session, uint control, ref byte array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  216. public delegate NiFpga_Status NiFpgaDll_WriteArrayI8(uint session, uint control, ref sbyte array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  217. public delegate NiFpga_Status NiFpgaDll_WriteArrayU8(uint session, uint control, ref byte array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  218. public delegate NiFpga_Status NiFpgaDll_WriteArrayI16(uint session, uint control, ref short array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  219. public delegate NiFpga_Status NiFpgaDll_WriteArrayU16(uint session, uint control, ref ushort array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  220. public delegate NiFpga_Status NiFpgaDll_WriteArrayI32(uint session, uint control, ref int array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  221. public delegate NiFpga_Status NiFpgaDll_WriteArrayU32(uint session, uint control, ref uint array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  222. public delegate NiFpga_Status NiFpgaDll_WriteArrayI64(uint session, uint control, ref long array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  223. public delegate NiFpga_Status NiFpgaDll_WriteArrayU64(uint session, uint control, ref ulong array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  224. public delegate NiFpga_Status NiFpgaDll_WriteArraySgl(uint session, uint control, ref float array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  225. public delegate NiFpga_Status NiFpgaDll_WriteArrayDbl(uint session, uint control, ref double array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  226. public delegate NiFpga_Status NiFpgaDll_ReserveIrqContext(uint session, ref System.IntPtr context);
  227. public delegate NiFpga_Status NiFpgaDll_UnreserveIrqContext(uint session, System.IntPtr context);
  228. 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);
  229. public delegate NiFpga_Status NiFpgaDll_AcknowledgeIrqs(uint session, NiFpga_Irq irqs);
  230. public delegate NiFpga_Status NiFpgaDll_ConfigureFifo(uint session, uint fifo, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint depth);
  231. public delegate NiFpga_Status NiFpgaDll_ConfigureFifo2(uint session, uint fifo, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint requestedDepth, ref uint actualDepth);
  232. public delegate NiFpga_Status NiFpgaDll_SetFifoPropertyU32(uint session, uint fifo, NiFpga_FifoProperty property, uint value);
  233. public delegate NiFpga_Status NiFpgaDll_SetFifoPropertyI32(uint session, uint fifo, NiFpga_FifoProperty property, int value);
  234. public delegate NiFpga_Status NiFpgaDll_SetFifoPropertyU64(uint session, uint fifo, NiFpga_FifoProperty property, ulong value);
  235. public delegate NiFpga_Status NiFpgaDll_SetFifoPropertyI64(uint session, uint fifo, NiFpga_FifoProperty property, long value);
  236. public delegate NiFpga_Status NiFpgaDll_SetFifoPropertyPtr(uint session, uint fifo, NiFpga_FifoProperty property, IntPtr value);
  237. public delegate NiFpga_Status NiFpgaDll_GetFifoPropertyU32(uint session, uint fifo, NiFpga_FifoProperty property, ref uint value);
  238. public delegate NiFpga_Status NiFpgaDll_GetFifoPropertyI32(uint session, uint fifo, NiFpga_FifoProperty property, ref int value);
  239. public delegate NiFpga_Status NiFpgaDll_GetFifoPropertyU64(uint session, uint fifo, NiFpga_FifoProperty property, ref ulong value);
  240. public delegate NiFpga_Status NiFpgaDll_GetFifoPropertyI64(uint session, uint fifo, NiFpga_FifoProperty property, ref long value);
  241. public delegate NiFpga_Status NiFpgaDll_GetFifoPropertyPtr(uint session, uint fifo, NiFpga_FifoProperty property, ref IntPtr value);
  242. public delegate NiFpga_Status NiFpgaDll_CommitFifoConfiguration(uint session, uint fifo);
  243. public delegate NiFpga_Status NiFpgaDll_StartFifo(uint session, uint fifo);
  244. public delegate NiFpga_Status NiFpgaDll_StopFifo(uint session, uint fifo);
  245. public delegate NiFpga_Status NiFpgaDll_UnreserveFifo(uint session, uint fifo);
  246. 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);
  247. 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);
  248. 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);
  249. 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);
  250. 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);
  251. 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);
  252. 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);
  253. 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);
  254. 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);
  255. 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);
  256. 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);
  257. 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);
  258. 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);
  259. 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);
  260. 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);
  261. 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);
  262. 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);
  263. 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);
  264. 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);
  265. 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);
  266. 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);
  267. 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);
  268. 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);
  269. 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);
  270. 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);
  271. 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);
  272. 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);
  273. 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);
  274. 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);
  275. 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);
  276. 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);
  277. 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);
  278. 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);
  279. 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);
  280. 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);
  281. 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);
  282. 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);
  283. 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);
  284. 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);
  285. 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);
  286. 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);
  287. 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);
  288. 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);
  289. 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);
  290. 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);
  291. public delegate NiFpga_Status NiFpgaDll_ReleaseFifoElements(uint session, uint fifo, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elements);
  292. public delegate NiFpga_Status NiFpgaDll_GetPeerToPeerFifoEndpoint(uint session, uint fifo, ref uint endpoint);
  293. }
  294. }