コード例 #1
0
        public void GetInfo(out string chain, out int device_index, out int link_instance)
        {
            IntPtr param = IntPtr.Zero;

            JtagAtlanticNativeMethods.jtagatlantic_get_info(_handle, ref param, out device_index, out link_instance);
            chain = Marshal.PtrToStringAnsi(param);
        }
コード例 #2
0
        public static int GetError(out string error)
        {
            IntPtr buffer = IntPtr.Zero;
            int    ret    = JtagAtlanticNativeMethods.jtagatlantic_get_error(ref buffer);

            error = Marshal.PtrToStringAnsi(buffer);
            return(ret);
        }
コード例 #3
0
        public void Close()
        {
            var handle = Interlocked.Exchange(ref _handle, IntPtr.Zero);

            if (handle != IntPtr.Zero)
            {
                JtagAtlanticNativeMethods.jtagatlantic_close(handle);
            }
        }
コード例 #4
0
        public JtagAtlanticConnection(string chain, int deviceIndex, int linkInstance, string appName)
        {
            _handle = JtagAtlanticNativeMethods.jtagatlantic_open(chain, deviceIndex, linkInstance, appName);

            if (_handle == IntPtr.Zero)
            {
                throw new Exception(
                          string.Format("Cannot open {0} index={1} instance={2}", chain, deviceIndex, linkInstance));
            }
            JtagAtlanticNativeMethods.jtagatlantic_wait_open(_handle);
        }
コード例 #5
0
 public int Flush()
 {
     return(JtagAtlanticNativeMethods.jtagatlantic_flush(_handle));
 }
コード例 #6
0
 public int BytesAvaliable()
 {
     return(JtagAtlanticNativeMethods.jtagatlantic_bytes_available(_handle));
 }
コード例 #7
0
 public int Write(byte[] buffer, int count)
 {
     return(JtagAtlanticNativeMethods.jtagatlantic_write(_handle, buffer, count));
 }
コード例 #8
0
 public int Write(byte[] buffer)
 {
     return(JtagAtlanticNativeMethods.jtagatlantic_write(_handle, buffer, buffer.Length));
 }
コード例 #9
0
 public int Read(byte[] buffer)
 {
     return(JtagAtlanticNativeMethods.jtagatlantic_read(_handle, buffer, buffer.Length));
 }