// V1.00: 21/04/2011: MB : Release
// V1.01: 23/08/2012: DB : Correction Fonction Close: Void->int
// V1.02: 26/08/2014: MB : Création de la version x64 - Convention d'appel stcall-> cdecl


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace Test_TCUSB48IO
{
    class TCUSB48IOx64
    {
        /***********************************************************************************************************************************************\
        *********************************************************** OPERATIONS DE BASE ******************************************************************
        \***********************************************************************************************************************************************/
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern int TCUSB48IO_Refresh(int NModule);
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern int TCUSB48IO_OpenN(int NModule, ref uint NumSerie);
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern int TCUSB48IO_Close(int NModule);
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern int TCUSB48IO_Input(int NModule, ref uint Data);
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern int TCUSB48IO_Output(int NModule, ushort Data);
        /***********************************************************************************************************************************************\
        *********************************************************** OPERATIONS SUR BITS *****************************************************************
        \***********************************************************************************************************************************************/
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern int TCUSB48IO_BitInput(int NModule, int Entree);
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern void TCUSB48IO_BitOutput(int NModule, int Sortie, int etat);
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern int TCUSB48IO_BitReadBack(int NModule, int Sortie);
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern int TCUSB48IO_Counter(int NModule, int Entree, ref byte Data);
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern int TCUSB48IO_WdgRun(int NModule);
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern void TCUSB48IO_WdgStop(int NModule);
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern void TCUSB48IO_WdgRearm(int NModule);
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern void TCUSB48IO_ResetPort(int NModule);
        [DllImport("TCUSB48IOx64.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, SetLastError = true, ExactSpelling = true)]
        public static extern void TCUSB48IO_CyclePort(int NModule);
    }
}
