1pub type timeval = libc::timeval;
4#[deprecated] pub const SIO_RESET_PURGE_RX: u32 = 1;
5#[deprecated] pub const SIO_RESET_PURGE_TX: u32 = 2;
6
7pub const SIO_RESET: u32 = 0;
8pub const SIO_MODEM_CTRL: u32 = 1;
9pub const SIO_SET_FLOW_CTRL: u32 = 2;
10pub const SIO_SET_BAUD_RATE: u32 = 3;
11pub const SIO_SET_DATA: u32 = 4;
12pub const SIO_RESET_REQUEST: u32 = 0;
13pub const SIO_SET_BAUDRATE_REQUEST: u32 = 3;
14pub const SIO_SET_DATA_REQUEST: u32 = 4;
15pub const SIO_SET_FLOW_CTRL_REQUEST: u32 = 2;
16pub const SIO_SET_MODEM_CTRL_REQUEST: u32 = 1;
17pub const SIO_POLL_MODEM_STATUS_REQUEST: u32 = 5;
18pub const SIO_SET_EVENT_CHAR_REQUEST: u32 = 6;
19pub const SIO_SET_ERROR_CHAR_REQUEST: u32 = 7;
20pub const SIO_SET_LATENCY_TIMER_REQUEST: u32 = 9;
21pub const SIO_GET_LATENCY_TIMER_REQUEST: u32 = 10;
22pub const SIO_SET_BITMODE_REQUEST: u32 = 11;
23pub const SIO_READ_PINS_REQUEST: u32 = 12;
24pub const SIO_READ_EEPROM_REQUEST: u32 = 144;
25pub const SIO_WRITE_EEPROM_REQUEST: u32 = 145;
26pub const SIO_ERASE_EEPROM_REQUEST: u32 = 146;
27pub const SIO_RESET_SIO: u32 = 0;
28pub const SIO_TCIFLUSH: u32 = 2;
29pub const SIO_TCOFLUSH: u32 = 1;
30pub const SIO_DISABLE_FLOW_CTRL: ::std::os::raw::c_int = 0;
31pub const SIO_RTS_CTS_HS: ::std::os::raw::c_int = 256;
32pub const SIO_DTR_DSR_HS: ::std::os::raw::c_int = 512;
33pub const SIO_XON_XOFF_HS: ::std::os::raw::c_int = 1024;
34pub const SIO_SET_DTR_MASK: u32 = 1;
35pub const SIO_SET_DTR_HIGH: u32 = 257;
36pub const SIO_SET_DTR_LOW: u32 = 256;
37pub const SIO_SET_RTS_MASK: u32 = 2;
38pub const SIO_SET_RTS_HIGH: u32 = 514;
39pub const SIO_SET_RTS_LOW: u32 = 512;
40impl ftdi_chip_type {
41 pub const TYPE_AM: ftdi_chip_type = ftdi_chip_type(0);
42}
43impl ftdi_chip_type {
44 pub const TYPE_BM: ftdi_chip_type = ftdi_chip_type(1);
45}
46impl ftdi_chip_type {
47 pub const TYPE_2232C: ftdi_chip_type = ftdi_chip_type(2);
48}
49impl ftdi_chip_type {
50 pub const TYPE_R: ftdi_chip_type = ftdi_chip_type(3);
51}
52impl ftdi_chip_type {
53 pub const TYPE_2232H: ftdi_chip_type = ftdi_chip_type(4);
54}
55impl ftdi_chip_type {
56 pub const TYPE_4232H: ftdi_chip_type = ftdi_chip_type(5);
57}
58impl ftdi_chip_type {
59 pub const TYPE_232H: ftdi_chip_type = ftdi_chip_type(6);
60}
61impl ftdi_chip_type {
62 pub const TYPE_230X: ftdi_chip_type = ftdi_chip_type(7);
63}
64#[repr(transparent)]
65#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
66pub struct ftdi_chip_type(pub ::std::os::raw::c_uint);
67impl ftdi_parity_type {
68 pub const NONE: ftdi_parity_type = ftdi_parity_type(0);
69}
70impl ftdi_parity_type {
71 pub const ODD: ftdi_parity_type = ftdi_parity_type(1);
72}
73impl ftdi_parity_type {
74 pub const EVEN: ftdi_parity_type = ftdi_parity_type(2);
75}
76impl ftdi_parity_type {
77 pub const MARK: ftdi_parity_type = ftdi_parity_type(3);
78}
79impl ftdi_parity_type {
80 pub const SPACE: ftdi_parity_type = ftdi_parity_type(4);
81}
82#[repr(transparent)]
83#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
84pub struct ftdi_parity_type(pub ::std::os::raw::c_uint);
85impl ftdi_stopbits_type {
86 pub const STOP_BIT_1: ftdi_stopbits_type = ftdi_stopbits_type(0);
87}
88impl ftdi_stopbits_type {
89 pub const STOP_BIT_15: ftdi_stopbits_type = ftdi_stopbits_type(1);
90}
91impl ftdi_stopbits_type {
92 pub const STOP_BIT_2: ftdi_stopbits_type = ftdi_stopbits_type(2);
93}
94#[repr(transparent)]
95#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
96pub struct ftdi_stopbits_type(pub ::std::os::raw::c_uint);
97impl ftdi_bits_type {
98 pub const BITS_7: ftdi_bits_type = ftdi_bits_type(7);
99}
100impl ftdi_bits_type {
101 pub const BITS_8: ftdi_bits_type = ftdi_bits_type(8);
102}
103#[repr(transparent)]
104#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
105pub struct ftdi_bits_type(pub ::std::os::raw::c_uint);
106impl ftdi_break_type {
107 pub const BREAK_OFF: ftdi_break_type = ftdi_break_type(0);
108}
109impl ftdi_break_type {
110 pub const BREAK_ON: ftdi_break_type = ftdi_break_type(1);
111}
112#[repr(transparent)]
113#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
114pub struct ftdi_break_type(pub ::std::os::raw::c_uint);
115impl ftdi_mpsse_mode {
116 pub const BITMODE_RESET: ftdi_mpsse_mode = ftdi_mpsse_mode(0);
117}
118impl ftdi_mpsse_mode {
119 pub const BITMODE_BITBANG: ftdi_mpsse_mode = ftdi_mpsse_mode(1);
120}
121impl ftdi_mpsse_mode {
122 pub const BITMODE_MPSSE: ftdi_mpsse_mode = ftdi_mpsse_mode(2);
123}
124impl ftdi_mpsse_mode {
125 pub const BITMODE_SYNCBB: ftdi_mpsse_mode = ftdi_mpsse_mode(4);
126}
127impl ftdi_mpsse_mode {
128 pub const BITMODE_MCU: ftdi_mpsse_mode = ftdi_mpsse_mode(8);
129}
130impl ftdi_mpsse_mode {
131 pub const BITMODE_OPTO: ftdi_mpsse_mode = ftdi_mpsse_mode(16);
132}
133impl ftdi_mpsse_mode {
134 pub const BITMODE_CBUS: ftdi_mpsse_mode = ftdi_mpsse_mode(32);
135}
136impl ftdi_mpsse_mode {
137 pub const BITMODE_SYNCFF: ftdi_mpsse_mode = ftdi_mpsse_mode(64);
138}
139impl ftdi_mpsse_mode {
140 pub const BITMODE_FT1284: ftdi_mpsse_mode = ftdi_mpsse_mode(128);
141}
142#[repr(transparent)]
143#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
144pub struct ftdi_mpsse_mode(pub ::std::os::raw::c_uint);
145impl ftdi_interface {
146 pub const INTERFACE_ANY: ftdi_interface = ftdi_interface(0);
147}
148impl ftdi_interface {
149 pub const INTERFACE_A: ftdi_interface = ftdi_interface(1);
150}
151impl ftdi_interface {
152 pub const INTERFACE_B: ftdi_interface = ftdi_interface(2);
153}
154impl ftdi_interface {
155 pub const INTERFACE_C: ftdi_interface = ftdi_interface(3);
156}
157impl ftdi_interface {
158 pub const INTERFACE_D: ftdi_interface = ftdi_interface(4);
159}
160#[repr(transparent)]
161#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
162pub struct ftdi_interface(pub ::std::os::raw::c_uint);
163impl ftdi_module_detach_mode {
164 pub const AUTO_DETACH_SIO_MODULE: ftdi_module_detach_mode = ftdi_module_detach_mode(0);
165}
166impl ftdi_module_detach_mode {
167 pub const DONT_DETACH_SIO_MODULE: ftdi_module_detach_mode = ftdi_module_detach_mode(1);
168}
169impl ftdi_module_detach_mode {
170 pub const AUTO_DETACH_REATACH_SIO_MODULE: ftdi_module_detach_mode = ftdi_module_detach_mode(2);
171}
172#[repr(transparent)]
173#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
174pub struct ftdi_module_detach_mode(pub ::std::os::raw::c_uint);
175#[repr(C)]
176#[derive(Debug)]
177pub struct ftdi_transfer_control {
178 pub completed: ::std::os::raw::c_int,
179 pub buf: *mut ::std::os::raw::c_uchar,
180 pub size: ::std::os::raw::c_int,
181 pub offset: ::std::os::raw::c_int,
182 pub ftdi: *mut ftdi_context,
183 pub transfer: *mut libusb_transfer,
184}
185#[repr(C)]
186#[derive(Debug)]
187pub struct ftdi_context {
188 pub usb_ctx: *mut libusb_context,
189 pub usb_dev: *mut libusb_device_handle,
190 pub usb_read_timeout: ::std::os::raw::c_int,
191 pub usb_write_timeout: ::std::os::raw::c_int,
192 pub type_: ftdi_chip_type,
193 pub baudrate: ::std::os::raw::c_int,
194 pub bitbang_enabled: ::std::os::raw::c_uchar,
195 pub readbuffer: *mut ::std::os::raw::c_uchar,
196 pub readbuffer_offset: ::std::os::raw::c_uint,
197 pub readbuffer_remaining: ::std::os::raw::c_uint,
198 pub readbuffer_chunksize: ::std::os::raw::c_uint,
199 pub writebuffer_chunksize: ::std::os::raw::c_uint,
200 pub max_packet_size: ::std::os::raw::c_uint,
201 pub interface: ::std::os::raw::c_int,
202 pub index: ::std::os::raw::c_int,
203 pub in_ep: ::std::os::raw::c_int,
204 pub out_ep: ::std::os::raw::c_int,
205 pub bitbang_mode: ::std::os::raw::c_uchar,
206 pub eeprom: *mut ftdi_eeprom,
207 pub error_str: *const ::std::os::raw::c_char,
208 pub module_detach_mode: ftdi_module_detach_mode,
209}
210impl ftdi_eeprom_value {
211 pub const VENDOR_ID: ftdi_eeprom_value = ftdi_eeprom_value(0);
212}
213impl ftdi_eeprom_value {
214 pub const PRODUCT_ID: ftdi_eeprom_value = ftdi_eeprom_value(1);
215}
216impl ftdi_eeprom_value {
217 pub const SELF_POWERED: ftdi_eeprom_value = ftdi_eeprom_value(2);
218}
219impl ftdi_eeprom_value {
220 pub const REMOTE_WAKEUP: ftdi_eeprom_value = ftdi_eeprom_value(3);
221}
222impl ftdi_eeprom_value {
223 pub const IS_NOT_PNP: ftdi_eeprom_value = ftdi_eeprom_value(4);
224}
225impl ftdi_eeprom_value {
226 pub const SUSPEND_DBUS7: ftdi_eeprom_value = ftdi_eeprom_value(5);
227}
228impl ftdi_eeprom_value {
229 pub const IN_IS_ISOCHRONOUS: ftdi_eeprom_value = ftdi_eeprom_value(6);
230}
231impl ftdi_eeprom_value {
232 pub const OUT_IS_ISOCHRONOUS: ftdi_eeprom_value = ftdi_eeprom_value(7);
233}
234impl ftdi_eeprom_value {
235 pub const SUSPEND_PULL_DOWNS: ftdi_eeprom_value = ftdi_eeprom_value(8);
236}
237impl ftdi_eeprom_value {
238 pub const USE_SERIAL: ftdi_eeprom_value = ftdi_eeprom_value(9);
239}
240impl ftdi_eeprom_value {
241 pub const USB_VERSION: ftdi_eeprom_value = ftdi_eeprom_value(10);
242}
243impl ftdi_eeprom_value {
244 pub const USE_USB_VERSION: ftdi_eeprom_value = ftdi_eeprom_value(11);
245}
246impl ftdi_eeprom_value {
247 pub const MAX_POWER: ftdi_eeprom_value = ftdi_eeprom_value(12);
248}
249impl ftdi_eeprom_value {
250 pub const CHANNEL_A_TYPE: ftdi_eeprom_value = ftdi_eeprom_value(13);
251}
252impl ftdi_eeprom_value {
253 pub const CHANNEL_B_TYPE: ftdi_eeprom_value = ftdi_eeprom_value(14);
254}
255impl ftdi_eeprom_value {
256 pub const CHANNEL_A_DRIVER: ftdi_eeprom_value = ftdi_eeprom_value(15);
257}
258impl ftdi_eeprom_value {
259 pub const CHANNEL_B_DRIVER: ftdi_eeprom_value = ftdi_eeprom_value(16);
260}
261impl ftdi_eeprom_value {
262 pub const CBUS_FUNCTION_0: ftdi_eeprom_value = ftdi_eeprom_value(17);
263}
264impl ftdi_eeprom_value {
265 pub const CBUS_FUNCTION_1: ftdi_eeprom_value = ftdi_eeprom_value(18);
266}
267impl ftdi_eeprom_value {
268 pub const CBUS_FUNCTION_2: ftdi_eeprom_value = ftdi_eeprom_value(19);
269}
270impl ftdi_eeprom_value {
271 pub const CBUS_FUNCTION_3: ftdi_eeprom_value = ftdi_eeprom_value(20);
272}
273impl ftdi_eeprom_value {
274 pub const CBUS_FUNCTION_4: ftdi_eeprom_value = ftdi_eeprom_value(21);
275}
276impl ftdi_eeprom_value {
277 pub const CBUS_FUNCTION_5: ftdi_eeprom_value = ftdi_eeprom_value(22);
278}
279impl ftdi_eeprom_value {
280 pub const CBUS_FUNCTION_6: ftdi_eeprom_value = ftdi_eeprom_value(23);
281}
282impl ftdi_eeprom_value {
283 pub const CBUS_FUNCTION_7: ftdi_eeprom_value = ftdi_eeprom_value(24);
284}
285impl ftdi_eeprom_value {
286 pub const CBUS_FUNCTION_8: ftdi_eeprom_value = ftdi_eeprom_value(25);
287}
288impl ftdi_eeprom_value {
289 pub const CBUS_FUNCTION_9: ftdi_eeprom_value = ftdi_eeprom_value(26);
290}
291impl ftdi_eeprom_value {
292 pub const HIGH_CURRENT: ftdi_eeprom_value = ftdi_eeprom_value(27);
293}
294impl ftdi_eeprom_value {
295 pub const HIGH_CURRENT_A: ftdi_eeprom_value = ftdi_eeprom_value(28);
296}
297impl ftdi_eeprom_value {
298 pub const HIGH_CURRENT_B: ftdi_eeprom_value = ftdi_eeprom_value(29);
299}
300impl ftdi_eeprom_value {
301 pub const INVERT: ftdi_eeprom_value = ftdi_eeprom_value(30);
302}
303impl ftdi_eeprom_value {
304 pub const GROUP0_DRIVE: ftdi_eeprom_value = ftdi_eeprom_value(31);
305}
306impl ftdi_eeprom_value {
307 pub const GROUP0_SCHMITT: ftdi_eeprom_value = ftdi_eeprom_value(32);
308}
309impl ftdi_eeprom_value {
310 pub const GROUP0_SLEW: ftdi_eeprom_value = ftdi_eeprom_value(33);
311}
312impl ftdi_eeprom_value {
313 pub const GROUP1_DRIVE: ftdi_eeprom_value = ftdi_eeprom_value(34);
314}
315impl ftdi_eeprom_value {
316 pub const GROUP1_SCHMITT: ftdi_eeprom_value = ftdi_eeprom_value(35);
317}
318impl ftdi_eeprom_value {
319 pub const GROUP1_SLEW: ftdi_eeprom_value = ftdi_eeprom_value(36);
320}
321impl ftdi_eeprom_value {
322 pub const GROUP2_DRIVE: ftdi_eeprom_value = ftdi_eeprom_value(37);
323}
324impl ftdi_eeprom_value {
325 pub const GROUP2_SCHMITT: ftdi_eeprom_value = ftdi_eeprom_value(38);
326}
327impl ftdi_eeprom_value {
328 pub const GROUP2_SLEW: ftdi_eeprom_value = ftdi_eeprom_value(39);
329}
330impl ftdi_eeprom_value {
331 pub const GROUP3_DRIVE: ftdi_eeprom_value = ftdi_eeprom_value(40);
332}
333impl ftdi_eeprom_value {
334 pub const GROUP3_SCHMITT: ftdi_eeprom_value = ftdi_eeprom_value(41);
335}
336impl ftdi_eeprom_value {
337 pub const GROUP3_SLEW: ftdi_eeprom_value = ftdi_eeprom_value(42);
338}
339impl ftdi_eeprom_value {
340 pub const CHIP_SIZE: ftdi_eeprom_value = ftdi_eeprom_value(43);
341}
342impl ftdi_eeprom_value {
343 pub const CHIP_TYPE: ftdi_eeprom_value = ftdi_eeprom_value(44);
344}
345impl ftdi_eeprom_value {
346 pub const POWER_SAVE: ftdi_eeprom_value = ftdi_eeprom_value(45);
347}
348impl ftdi_eeprom_value {
349 pub const CLOCK_POLARITY: ftdi_eeprom_value = ftdi_eeprom_value(46);
350}
351impl ftdi_eeprom_value {
352 pub const DATA_ORDER: ftdi_eeprom_value = ftdi_eeprom_value(47);
353}
354impl ftdi_eeprom_value {
355 pub const FLOW_CONTROL: ftdi_eeprom_value = ftdi_eeprom_value(48);
356}
357impl ftdi_eeprom_value {
358 pub const CHANNEL_C_DRIVER: ftdi_eeprom_value = ftdi_eeprom_value(49);
359}
360impl ftdi_eeprom_value {
361 pub const CHANNEL_D_DRIVER: ftdi_eeprom_value = ftdi_eeprom_value(50);
362}
363impl ftdi_eeprom_value {
364 pub const CHANNEL_A_RS485: ftdi_eeprom_value = ftdi_eeprom_value(51);
365}
366impl ftdi_eeprom_value {
367 pub const CHANNEL_B_RS485: ftdi_eeprom_value = ftdi_eeprom_value(52);
368}
369impl ftdi_eeprom_value {
370 pub const CHANNEL_C_RS485: ftdi_eeprom_value = ftdi_eeprom_value(53);
371}
372impl ftdi_eeprom_value {
373 pub const CHANNEL_D_RS485: ftdi_eeprom_value = ftdi_eeprom_value(54);
374}
375impl ftdi_eeprom_value {
376 pub const RELEASE_NUMBER: ftdi_eeprom_value = ftdi_eeprom_value(55);
377}
378impl ftdi_eeprom_value {
379 pub const EXTERNAL_OSCILLATOR: ftdi_eeprom_value = ftdi_eeprom_value(56);
380}
381impl ftdi_eeprom_value {
382 pub const USER_DATA_ADDR: ftdi_eeprom_value = ftdi_eeprom_value(57);
383}
384#[repr(transparent)]
385#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
386pub struct ftdi_eeprom_value(pub ::std::os::raw::c_uint);
387#[repr(C)]
388#[derive(Debug)]
389pub struct ftdi_device_list {
390 pub next: *mut ftdi_device_list,
391 pub dev: *mut libusb_device,
392}
393impl ftdi_cbus_func {
394 pub const CBUS_TXDEN: ftdi_cbus_func = ftdi_cbus_func(0);
395}
396impl ftdi_cbus_func {
397 pub const CBUS_PWREN: ftdi_cbus_func = ftdi_cbus_func(1);
398}
399impl ftdi_cbus_func {
400 pub const CBUS_RXLED: ftdi_cbus_func = ftdi_cbus_func(2);
401}
402impl ftdi_cbus_func {
403 pub const CBUS_TXLED: ftdi_cbus_func = ftdi_cbus_func(3);
404}
405impl ftdi_cbus_func {
406 pub const CBUS_TXRXLED: ftdi_cbus_func = ftdi_cbus_func(4);
407}
408impl ftdi_cbus_func {
409 pub const CBUS_SLEEP: ftdi_cbus_func = ftdi_cbus_func(5);
410}
411impl ftdi_cbus_func {
412 pub const CBUS_CLK48: ftdi_cbus_func = ftdi_cbus_func(6);
413}
414impl ftdi_cbus_func {
415 pub const CBUS_CLK24: ftdi_cbus_func = ftdi_cbus_func(7);
416}
417impl ftdi_cbus_func {
418 pub const CBUS_CLK12: ftdi_cbus_func = ftdi_cbus_func(8);
419}
420impl ftdi_cbus_func {
421 pub const CBUS_CLK6: ftdi_cbus_func = ftdi_cbus_func(9);
422}
423impl ftdi_cbus_func {
424 pub const CBUS_IOMODE: ftdi_cbus_func = ftdi_cbus_func(10);
425}
426impl ftdi_cbus_func {
427 pub const CBUS_BB_WR: ftdi_cbus_func = ftdi_cbus_func(11);
428}
429impl ftdi_cbus_func {
430 pub const CBUS_BB_RD: ftdi_cbus_func = ftdi_cbus_func(12);
431}
432#[repr(transparent)]
433#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
434pub struct ftdi_cbus_func(pub ::std::os::raw::c_uint);
435impl ftdi_cbush_func {
436 pub const CBUSH_TRISTATE: ftdi_cbush_func = ftdi_cbush_func(0);
437}
438impl ftdi_cbush_func {
439 pub const CBUSH_TXLED: ftdi_cbush_func = ftdi_cbush_func(1);
440}
441impl ftdi_cbush_func {
442 pub const CBUSH_RXLED: ftdi_cbush_func = ftdi_cbush_func(2);
443}
444impl ftdi_cbush_func {
445 pub const CBUSH_TXRXLED: ftdi_cbush_func = ftdi_cbush_func(3);
446}
447impl ftdi_cbush_func {
448 pub const CBUSH_PWREN: ftdi_cbush_func = ftdi_cbush_func(4);
449}
450impl ftdi_cbush_func {
451 pub const CBUSH_SLEEP: ftdi_cbush_func = ftdi_cbush_func(5);
452}
453impl ftdi_cbush_func {
454 pub const CBUSH_DRIVE_0: ftdi_cbush_func = ftdi_cbush_func(6);
455}
456impl ftdi_cbush_func {
457 pub const CBUSH_DRIVE1: ftdi_cbush_func = ftdi_cbush_func(7);
458}
459impl ftdi_cbush_func {
460 pub const CBUSH_IOMODE: ftdi_cbush_func = ftdi_cbush_func(8);
461}
462impl ftdi_cbush_func {
463 pub const CBUSH_TXDEN: ftdi_cbush_func = ftdi_cbush_func(9);
464}
465impl ftdi_cbush_func {
466 pub const CBUSH_CLK30: ftdi_cbush_func = ftdi_cbush_func(10);
467}
468impl ftdi_cbush_func {
469 pub const CBUSH_CLK15: ftdi_cbush_func = ftdi_cbush_func(11);
470}
471impl ftdi_cbush_func {
472 pub const CBUSH_CLK7_5: ftdi_cbush_func = ftdi_cbush_func(12);
473}
474#[repr(transparent)]
475#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
476pub struct ftdi_cbush_func(pub ::std::os::raw::c_uint);
477impl ftdi_cbusx_func {
478 pub const CBUSX_TRISTATE: ftdi_cbusx_func = ftdi_cbusx_func(0);
479}
480impl ftdi_cbusx_func {
481 pub const CBUSX_TXLED: ftdi_cbusx_func = ftdi_cbusx_func(1);
482}
483impl ftdi_cbusx_func {
484 pub const CBUSX_RXLED: ftdi_cbusx_func = ftdi_cbusx_func(2);
485}
486impl ftdi_cbusx_func {
487 pub const CBUSX_TXRXLED: ftdi_cbusx_func = ftdi_cbusx_func(3);
488}
489impl ftdi_cbusx_func {
490 pub const CBUSX_PWREN: ftdi_cbusx_func = ftdi_cbusx_func(4);
491}
492impl ftdi_cbusx_func {
493 pub const CBUSX_SLEEP: ftdi_cbusx_func = ftdi_cbusx_func(5);
494}
495impl ftdi_cbusx_func {
496 pub const CBUSX_DRIVE_0: ftdi_cbusx_func = ftdi_cbusx_func(6);
497}
498impl ftdi_cbusx_func {
499 pub const CBUSX_DRIVE1: ftdi_cbusx_func = ftdi_cbusx_func(7);
500}
501impl ftdi_cbusx_func {
502 pub const CBUSX_IOMODE: ftdi_cbusx_func = ftdi_cbusx_func(8);
503}
504impl ftdi_cbusx_func {
505 pub const CBUSX_TXDEN: ftdi_cbusx_func = ftdi_cbusx_func(9);
506}
507impl ftdi_cbusx_func {
508 pub const CBUSX_CLK24: ftdi_cbusx_func = ftdi_cbusx_func(10);
509}
510impl ftdi_cbusx_func {
511 pub const CBUSX_CLK12: ftdi_cbusx_func = ftdi_cbusx_func(11);
512}
513impl ftdi_cbusx_func {
514 pub const CBUSX_CLK6: ftdi_cbusx_func = ftdi_cbusx_func(12);
515}
516impl ftdi_cbusx_func {
517 pub const CBUSX_BAT_DETECT: ftdi_cbusx_func = ftdi_cbusx_func(13);
518}
519impl ftdi_cbusx_func {
520 pub const CBUSX_BAT_DETECT_NEG: ftdi_cbusx_func = ftdi_cbusx_func(14);
521}
522impl ftdi_cbusx_func {
523 pub const CBUSX_I2C_TXE: ftdi_cbusx_func = ftdi_cbusx_func(15);
524}
525impl ftdi_cbusx_func {
526 pub const CBUSX_I2C_RXF: ftdi_cbusx_func = ftdi_cbusx_func(16);
527}
528impl ftdi_cbusx_func {
529 pub const CBUSX_VBUS_SENSE: ftdi_cbusx_func = ftdi_cbusx_func(17);
530}
531impl ftdi_cbusx_func {
532 pub const CBUSX_BB_WR: ftdi_cbusx_func = ftdi_cbusx_func(18);
533}
534impl ftdi_cbusx_func {
535 pub const CBUSX_BB_RD: ftdi_cbusx_func = ftdi_cbusx_func(19);
536}
537impl ftdi_cbusx_func {
538 pub const CBUSX_TIME_STAMP: ftdi_cbusx_func = ftdi_cbusx_func(20);
539}
540impl ftdi_cbusx_func {
541 pub const CBUSX_AWAKE: ftdi_cbusx_func = ftdi_cbusx_func(21);
542}
543#[repr(transparent)]
544#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
545pub struct ftdi_cbusx_func(pub ::std::os::raw::c_uint);
546#[repr(C)]
547pub struct size_and_time {
548 pub totalBytes: u64,
549 pub time: timeval,
550}
551#[repr(C)]
552pub struct FTDIProgressInfo {
553 pub first: size_and_time,
554 pub prev: size_and_time,
555 pub current: size_and_time,
556 pub totalTime: f64,
557 pub totalRate: f64,
558 pub currentRate: f64,
559}
560pub type FTDIStreamCallback = ::std::option::Option<
561 unsafe extern "C" fn(
562 buffer: *mut u8,
563 length: ::std::os::raw::c_int,
564 progress: *mut FTDIProgressInfo,
565 userdata: *mut ::std::os::raw::c_void,
566 ) -> ::std::os::raw::c_int,
567>;
568#[repr(C)]
569#[derive(Debug, Copy, Clone)]
570pub struct ftdi_version_info {
571 pub major: ::std::os::raw::c_int,
572 pub minor: ::std::os::raw::c_int,
573 pub micro: ::std::os::raw::c_int,
574 pub version_str: *const ::std::os::raw::c_char,
575 pub snapshot_str: *const ::std::os::raw::c_char,
576}
577extern "C" {
578 pub fn ftdi_init(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
579}
580extern "C" {
581 pub fn ftdi_new() -> *mut ftdi_context;
582}
583extern "C" {
584 pub fn ftdi_set_interface(
585 ftdi: *mut ftdi_context,
586 interface: ftdi_interface,
587 ) -> ::std::os::raw::c_int;
588}
589extern "C" {
590 pub fn ftdi_deinit(ftdi: *mut ftdi_context);
591}
592extern "C" {
593 pub fn ftdi_free(ftdi: *mut ftdi_context);
594}
595extern "C" {
596 pub fn ftdi_set_usbdev(ftdi: *mut ftdi_context, usbdev: *mut libusb_device_handle);
597}
598extern "C" {
599 pub fn ftdi_get_library_version() -> ftdi_version_info;
600}
601extern "C" {
602 pub fn ftdi_usb_find_all(
603 ftdi: *mut ftdi_context,
604 devlist: *mut *mut ftdi_device_list,
605 vendor: ::std::os::raw::c_int,
606 product: ::std::os::raw::c_int,
607 ) -> ::std::os::raw::c_int;
608}
609extern "C" {
610 pub fn ftdi_list_free(devlist: *mut *mut ftdi_device_list);
611}
612extern "C" {
613 pub fn ftdi_list_free2(devlist: *mut ftdi_device_list);
614}
615extern "C" {
616 pub fn ftdi_usb_get_strings(
617 ftdi: *mut ftdi_context,
618 dev: *mut libusb_device,
619 manufacturer: *mut ::std::os::raw::c_char,
620 mnf_len: ::std::os::raw::c_int,
621 description: *mut ::std::os::raw::c_char,
622 desc_len: ::std::os::raw::c_int,
623 serial: *mut ::std::os::raw::c_char,
624 serial_len: ::std::os::raw::c_int,
625 ) -> ::std::os::raw::c_int;
626}
627extern "C" {
628 pub fn ftdi_usb_get_strings2(
629 ftdi: *mut ftdi_context,
630 dev: *mut libusb_device,
631 manufacturer: *mut ::std::os::raw::c_char,
632 mnf_len: ::std::os::raw::c_int,
633 description: *mut ::std::os::raw::c_char,
634 desc_len: ::std::os::raw::c_int,
635 serial: *mut ::std::os::raw::c_char,
636 serial_len: ::std::os::raw::c_int,
637 ) -> ::std::os::raw::c_int;
638}
639extern "C" {
640 pub fn ftdi_eeprom_get_strings(
641 ftdi: *mut ftdi_context,
642 manufacturer: *mut ::std::os::raw::c_char,
643 mnf_len: ::std::os::raw::c_int,
644 product: *mut ::std::os::raw::c_char,
645 prod_len: ::std::os::raw::c_int,
646 serial: *mut ::std::os::raw::c_char,
647 serial_len: ::std::os::raw::c_int,
648 ) -> ::std::os::raw::c_int;
649}
650extern "C" {
651 pub fn ftdi_eeprom_set_strings(
652 ftdi: *mut ftdi_context,
653 manufacturer: *const ::std::os::raw::c_char,
654 product: *const ::std::os::raw::c_char,
655 serial: *const ::std::os::raw::c_char,
656 ) -> ::std::os::raw::c_int;
657}
658extern "C" {
659 pub fn ftdi_usb_open(
660 ftdi: *mut ftdi_context,
661 vendor: ::std::os::raw::c_int,
662 product: ::std::os::raw::c_int,
663 ) -> ::std::os::raw::c_int;
664}
665extern "C" {
666 pub fn ftdi_usb_open_desc(
667 ftdi: *mut ftdi_context,
668 vendor: ::std::os::raw::c_int,
669 product: ::std::os::raw::c_int,
670 description: *const ::std::os::raw::c_char,
671 serial: *const ::std::os::raw::c_char,
672 ) -> ::std::os::raw::c_int;
673}
674extern "C" {
675 pub fn ftdi_usb_open_desc_index(
676 ftdi: *mut ftdi_context,
677 vendor: ::std::os::raw::c_int,
678 product: ::std::os::raw::c_int,
679 description: *const ::std::os::raw::c_char,
680 serial: *const ::std::os::raw::c_char,
681 index: ::std::os::raw::c_uint,
682 ) -> ::std::os::raw::c_int;
683}
684extern "C" {
685 pub fn ftdi_usb_open_bus_addr(
686 ftdi: *mut ftdi_context,
687 bus: u8,
688 addr: u8,
689 ) -> ::std::os::raw::c_int;
690}
691extern "C" {
692 pub fn ftdi_usb_open_dev(
693 ftdi: *mut ftdi_context,
694 dev: *mut libusb_device,
695 ) -> ::std::os::raw::c_int;
696}
697extern "C" {
698 pub fn ftdi_usb_open_string(
699 ftdi: *mut ftdi_context,
700 description: *const ::std::os::raw::c_char,
701 ) -> ::std::os::raw::c_int;
702}
703extern "C" {
704 pub fn ftdi_usb_close(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
705}
706extern "C" {
707 pub fn ftdi_usb_reset(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
708}
709extern "C" {
710 pub fn ftdi_tciflush(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
711}
712extern "C" {
713 pub fn ftdi_tcoflush(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
714}
715extern "C" {
716 pub fn ftdi_tcioflush(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
717}
718extern "C" {
719 pub fn ftdi_usb_purge_rx_buffer(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
720}
721extern "C" {
722 pub fn ftdi_usb_purge_tx_buffer(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
723}
724extern "C" {
725 pub fn ftdi_usb_purge_buffers(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
726}
727extern "C" {
728 pub fn ftdi_set_baudrate(
729 ftdi: *mut ftdi_context,
730 baudrate: ::std::os::raw::c_int,
731 ) -> ::std::os::raw::c_int;
732}
733extern "C" {
734 pub fn ftdi_set_line_property(
735 ftdi: *mut ftdi_context,
736 bits: ftdi_bits_type,
737 sbit: ftdi_stopbits_type,
738 parity: ftdi_parity_type,
739 ) -> ::std::os::raw::c_int;
740}
741extern "C" {
742 pub fn ftdi_set_line_property2(
743 ftdi: *mut ftdi_context,
744 bits: ftdi_bits_type,
745 sbit: ftdi_stopbits_type,
746 parity: ftdi_parity_type,
747 break_type: ftdi_break_type,
748 ) -> ::std::os::raw::c_int;
749}
750extern "C" {
751 pub fn ftdi_read_data(
752 ftdi: *mut ftdi_context,
753 buf: *mut ::std::os::raw::c_uchar,
754 size: ::std::os::raw::c_int,
755 ) -> ::std::os::raw::c_int;
756}
757extern "C" {
758 pub fn ftdi_read_data_set_chunksize(
759 ftdi: *mut ftdi_context,
760 chunksize: ::std::os::raw::c_uint,
761 ) -> ::std::os::raw::c_int;
762}
763extern "C" {
764 pub fn ftdi_read_data_get_chunksize(
765 ftdi: *mut ftdi_context,
766 chunksize: *mut ::std::os::raw::c_uint,
767 ) -> ::std::os::raw::c_int;
768}
769extern "C" {
770 pub fn ftdi_write_data(
771 ftdi: *mut ftdi_context,
772 buf: *const ::std::os::raw::c_uchar,
773 size: ::std::os::raw::c_int,
774 ) -> ::std::os::raw::c_int;
775}
776extern "C" {
777 pub fn ftdi_write_data_set_chunksize(
778 ftdi: *mut ftdi_context,
779 chunksize: ::std::os::raw::c_uint,
780 ) -> ::std::os::raw::c_int;
781}
782extern "C" {
783 pub fn ftdi_write_data_get_chunksize(
784 ftdi: *mut ftdi_context,
785 chunksize: *mut ::std::os::raw::c_uint,
786 ) -> ::std::os::raw::c_int;
787}
788extern "C" {
789 pub fn ftdi_readstream(
790 ftdi: *mut ftdi_context,
791 callback: FTDIStreamCallback,
792 userdata: *mut ::std::os::raw::c_void,
793 packetsPerTransfer: ::std::os::raw::c_int,
794 numTransfers: ::std::os::raw::c_int,
795 ) -> ::std::os::raw::c_int;
796}
797extern "C" {
798 pub fn ftdi_write_data_submit(
799 ftdi: *mut ftdi_context,
800 buf: *mut ::std::os::raw::c_uchar,
801 size: ::std::os::raw::c_int,
802 ) -> *mut ftdi_transfer_control;
803}
804extern "C" {
805 pub fn ftdi_read_data_submit(
806 ftdi: *mut ftdi_context,
807 buf: *mut ::std::os::raw::c_uchar,
808 size: ::std::os::raw::c_int,
809 ) -> *mut ftdi_transfer_control;
810}
811extern "C" {
812 pub fn ftdi_transfer_data_done(tc: *mut ftdi_transfer_control) -> ::std::os::raw::c_int;
813}
814extern "C" {
815 pub fn ftdi_transfer_data_cancel(tc: *mut ftdi_transfer_control, to: *mut timeval);
816}
817extern "C" {
818 pub fn ftdi_set_bitmode(
819 ftdi: *mut ftdi_context,
820 bitmask: ::std::os::raw::c_uchar,
821 mode: ::std::os::raw::c_uchar,
822 ) -> ::std::os::raw::c_int;
823}
824extern "C" {
825 pub fn ftdi_disable_bitbang(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
826}
827extern "C" {
828 pub fn ftdi_read_pins(
829 ftdi: *mut ftdi_context,
830 pins: *mut ::std::os::raw::c_uchar,
831 ) -> ::std::os::raw::c_int;
832}
833extern "C" {
834 pub fn ftdi_set_latency_timer(
835 ftdi: *mut ftdi_context,
836 latency: ::std::os::raw::c_uchar,
837 ) -> ::std::os::raw::c_int;
838}
839extern "C" {
840 pub fn ftdi_get_latency_timer(
841 ftdi: *mut ftdi_context,
842 latency: *mut ::std::os::raw::c_uchar,
843 ) -> ::std::os::raw::c_int;
844}
845extern "C" {
846 pub fn ftdi_poll_modem_status(
847 ftdi: *mut ftdi_context,
848 status: *mut ::std::os::raw::c_ushort,
849 ) -> ::std::os::raw::c_int;
850}
851extern "C" {
852 pub fn ftdi_setflowctrl(
853 ftdi: *mut ftdi_context,
854 flowctrl: ::std::os::raw::c_int,
855 ) -> ::std::os::raw::c_int;
856}
857extern "C" {
858 pub fn ftdi_setflowctrl_xonxoff(
859 ftdi: *mut ftdi_context,
860 xon: ::std::os::raw::c_uchar,
861 xoff: ::std::os::raw::c_uchar,
862 ) -> ::std::os::raw::c_int;
863}
864extern "C" {
865 pub fn ftdi_setdtr_rts(
866 ftdi: *mut ftdi_context,
867 dtr: ::std::os::raw::c_int,
868 rts: ::std::os::raw::c_int,
869 ) -> ::std::os::raw::c_int;
870}
871extern "C" {
872 pub fn ftdi_setdtr(
873 ftdi: *mut ftdi_context,
874 state: ::std::os::raw::c_int,
875 ) -> ::std::os::raw::c_int;
876}
877extern "C" {
878 pub fn ftdi_setrts(
879 ftdi: *mut ftdi_context,
880 state: ::std::os::raw::c_int,
881 ) -> ::std::os::raw::c_int;
882}
883extern "C" {
884 pub fn ftdi_set_event_char(
885 ftdi: *mut ftdi_context,
886 eventch: ::std::os::raw::c_uchar,
887 enable: ::std::os::raw::c_uchar,
888 ) -> ::std::os::raw::c_int;
889}
890extern "C" {
891 pub fn ftdi_set_error_char(
892 ftdi: *mut ftdi_context,
893 errorch: ::std::os::raw::c_uchar,
894 enable: ::std::os::raw::c_uchar,
895 ) -> ::std::os::raw::c_int;
896}
897extern "C" {
898 pub fn ftdi_eeprom_initdefaults(
899 ftdi: *mut ftdi_context,
900 manufacturer: *mut ::std::os::raw::c_char,
901 product: *mut ::std::os::raw::c_char,
902 serial: *mut ::std::os::raw::c_char,
903 ) -> ::std::os::raw::c_int;
904}
905extern "C" {
906 pub fn ftdi_eeprom_build(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
907}
908extern "C" {
909 pub fn ftdi_eeprom_decode(
910 ftdi: *mut ftdi_context,
911 verbose: ::std::os::raw::c_int,
912 ) -> ::std::os::raw::c_int;
913}
914extern "C" {
915 pub fn ftdi_get_eeprom_value(
916 ftdi: *mut ftdi_context,
917 value_name: ftdi_eeprom_value,
918 value: *mut ::std::os::raw::c_int,
919 ) -> ::std::os::raw::c_int;
920}
921extern "C" {
922 pub fn ftdi_set_eeprom_value(
923 ftdi: *mut ftdi_context,
924 value_name: ftdi_eeprom_value,
925 value: ::std::os::raw::c_int,
926 ) -> ::std::os::raw::c_int;
927}
928extern "C" {
929 pub fn ftdi_get_eeprom_buf(
930 ftdi: *mut ftdi_context,
931 buf: *mut ::std::os::raw::c_uchar,
932 size: ::std::os::raw::c_int,
933 ) -> ::std::os::raw::c_int;
934}
935extern "C" {
936 pub fn ftdi_set_eeprom_buf(
937 ftdi: *mut ftdi_context,
938 buf: *const ::std::os::raw::c_uchar,
939 size: ::std::os::raw::c_int,
940 ) -> ::std::os::raw::c_int;
941}
942extern "C" {
943 pub fn ftdi_set_eeprom_user_data(
944 ftdi: *mut ftdi_context,
945 buf: *const ::std::os::raw::c_char,
946 size: ::std::os::raw::c_int,
947 ) -> ::std::os::raw::c_int;
948}
949extern "C" {
950 pub fn ftdi_read_eeprom(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
951}
952extern "C" {
953 pub fn ftdi_read_chipid(
954 ftdi: *mut ftdi_context,
955 chipid: *mut ::std::os::raw::c_uint,
956 ) -> ::std::os::raw::c_int;
957}
958extern "C" {
959 pub fn ftdi_write_eeprom(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
960}
961extern "C" {
962 pub fn ftdi_erase_eeprom(ftdi: *mut ftdi_context) -> ::std::os::raw::c_int;
963}
964extern "C" {
965 pub fn ftdi_read_eeprom_location(
966 ftdi: *mut ftdi_context,
967 eeprom_addr: ::std::os::raw::c_int,
968 eeprom_val: *mut ::std::os::raw::c_ushort,
969 ) -> ::std::os::raw::c_int;
970}
971extern "C" {
972 pub fn ftdi_write_eeprom_location(
973 ftdi: *mut ftdi_context,
974 eeprom_addr: ::std::os::raw::c_int,
975 eeprom_val: ::std::os::raw::c_ushort,
976 ) -> ::std::os::raw::c_int;
977}
978extern "C" {
979 pub fn ftdi_get_error_string(ftdi: *mut ftdi_context) -> *const ::std::os::raw::c_char;
980}
981#[repr(C)]
982#[derive(Debug)]
983pub struct ftdi_eeprom {
984 pub _address: u8,
985}