Example #1
0
        public static unsafe IntPtr[] GetDeviceList(int vendor, int product)
        {
            ArrayList         ar = new ArrayList();
            ftdi_device_list *devlist, d;
            ftdi_context      ftdi = new ftdi_context();

            ftdi_init(ref ftdi);

            if (ftdi_usb_find_all(ref ftdi, &devlist, vendor, product) < 0)
            {
                throw new Exception("ftdi_usb_find_all failed");
            }

            for (d = devlist; d != null; d = d->next)
            {
                ar.Add(d->dev);
            }

            ftdi_deinit(ref ftdi);

            ftdi_list_free(&devlist);

            return((IntPtr[])ar.ToArray(typeof(IntPtr)));
        }
Example #2
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_read_pins(ref ftdi_context ftdi, out byte pins);
Example #3
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_set_interface(ref ftdi_context ftdi, Interface iface);
Example #4
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_write_data(ref ftdi_context ftdi, byte[] buf, int size);
Example #5
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_erase_eeprom(ref ftdi_context ftdi);
Example #6
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_usb_open(ref ftdi_context ftdi, int vendor, int product);
Example #7
0
 [DllImport("libftdi.so.0")] internal unsafe static extern int ftdi_usb_find_all(ref ftdi_context ftdi, ftdi_device_list **devlist, int vendor, int product);
Example #8
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_set_bitmode(ref ftdi_context ftdi, byte bitmask, byte mode);
Example #9
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_write_data_get_chunksize(ref ftdi_context ftdi, out uint chunksize);
Example #10
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_read_data_set_chunksize(ref ftdi_context ftdi, uint chunksize);
Example #11
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_usb_purge_buffers(ref ftdi_context ftdi);
Example #12
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_usb_close(ref ftdi_context ftdi);
Example #13
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_set_baudrate(ref ftdi_context ftdi, int baudrate);
Example #14
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_usb_open_dev(ref ftdi_context ftdi, IntPtr dev);
Example #15
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_usb_open_desc(ref ftdi_context ftdi, int vendor, int product, string description, string serial);
Example #16
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_enable_bitbang(ref ftdi_context ftdi, byte bitmask);
Example #17
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_disable_bitbang(ref ftdi_context ftdi);
Example #18
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_get_latency_timer(ref ftdi_context ftdi, out byte latency);
Example #19
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_set_line_property(ref ftdi_context ftdi, BitsType bits, StopBitsType sbit, ParityType parity);
Example #20
0
 [DllImport("libftdi.so.0")] internal static extern IntPtr ftdi_get_error_string(ref ftdi_context ftdi);
Example #21
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_write_eeprom(ref ftdi_context ftdi, ref byte[] eeprom);
Example #22
0
 [DllImport("libftdi.so.0")] internal static extern void ftdi_deinit(ref ftdi_context ftdi);