//===== Функции класса ================================================= //Упрощенные и адаптированные аналоги функций из PCI429_4.DLL /// <summary> /// Инициализация платы. Аналог pci429_4_open(...) /// </summary> /// <param name="sn">(in) Серийный номер платы</param> public GPCI429(ushort sn) { int i; // Выделение места для буферов принимаемой информации this.input_buffer = new uint[16][]; for (i = 0; i < this.input_buffer.Length; i++) { this.input_buffer[i] = new uint[256]; } // Выделение места для информации о плате и задание нач. значений. this.dev = new pci429_4_tag { handle = (IntPtr) unchecked (( int )pci429_4_errors.INVALID_HANDLE_VALUE) }; //Info.LastReadPtr = new ushort[16]; // Можно не делать, так как маршалинг при вызове функции из DLL //Info.FreqPBK = new ushort[32]; // (неуправляемый код) сделает это за нас. // Инициализация платы this.error_ = NativeMethods.pci429_4_open(sn, out this.dev); }
internal static extern uint pci429_4_read_rk(ref pci429_4_tag dev, out ushort rk);
internal static extern uint pci429_4_write_rk(ref pci429_4_tag dev, ushort rk);
internal static extern uint pci429_4_set_freq(ref pci429_4_tag dev, byte type, byte nk, FREQ freq, bool parity_off);
internal static extern uint pci429_4_read_rx(ref pci429_4_tag dev, ushort nk, IntPtr buf, ref uint buf_size);
internal static extern uint pci429_4_write_tx(ref pci429_4_tag dev, ushort nk, IntPtr buf, uint buf_size);
internal static extern uint pci429_4_check_tx(ref pci429_4_tag dev, ushort nk);
internal static extern uint pci429_4_start(ref pci429_4_tag dev, ushort kcp);
internal static extern uint pci429_4_get_address(ref pci429_4_tag dev, out ushort PLX_address, out ushort userAddress, out ushort irq);
internal static extern uint pci429_4_get_serial_number(ref pci429_4_tag dev, out ushort sn);
internal static extern uint pci429_4_close(ref pci429_4_tag dev);
internal static extern uint pci429_4_open(ushort sn, out pci429_4_tag dev);
internal static extern uint pci429_4_reset(ref pci429_4_tag dev, out ushort id);
internal static extern uint pci429_4_get_state(ref pci429_4_tag dev, out ushort prev_mode, out ushort currentMode, out ushort version, out ushort testResult);