示例#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)));
        }
示例#2
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_read_pins(ref ftdi_context ftdi, out byte pins);
示例#3
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_set_interface(ref ftdi_context ftdi, Interface iface);
示例#4
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_write_data(ref ftdi_context ftdi, byte[] buf, int size);
示例#5
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_erase_eeprom(ref ftdi_context ftdi);
示例#6
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_usb_open(ref ftdi_context ftdi, int vendor, int product);
示例#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);
示例#8
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_set_bitmode(ref ftdi_context ftdi, byte bitmask, byte mode);
示例#9
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_write_data_get_chunksize(ref ftdi_context ftdi, out uint chunksize);
示例#10
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_read_data_set_chunksize(ref ftdi_context ftdi, uint chunksize);
示例#11
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_usb_purge_buffers(ref ftdi_context ftdi);
示例#12
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_usb_close(ref ftdi_context ftdi);
示例#13
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_set_baudrate(ref ftdi_context ftdi, int baudrate);
示例#14
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_usb_open_dev(ref ftdi_context ftdi, IntPtr dev);
示例#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);
示例#16
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_enable_bitbang(ref ftdi_context ftdi, byte bitmask);
示例#17
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_disable_bitbang(ref ftdi_context ftdi);
示例#18
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_get_latency_timer(ref ftdi_context ftdi, out byte latency);
示例#19
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_set_line_property(ref ftdi_context ftdi, BitsType bits, StopBitsType sbit, ParityType parity);
示例#20
0
 [DllImport("libftdi.so.0")] internal static extern IntPtr ftdi_get_error_string(ref ftdi_context ftdi);
示例#21
0
 [DllImport("libftdi.so.0")] internal static extern int ftdi_write_eeprom(ref ftdi_context ftdi, ref byte[] eeprom);
示例#22
0
 [DllImport("libftdi.so.0")] internal static extern void ftdi_deinit(ref ftdi_context ftdi);