libftdi1 1.5
ftdi.cpp
Go to the documentation of this file.
1/***************************************************************************
2 ftdi.cpp - C++ wrapper for libftdi
3 -------------------
4 begin : Mon Oct 13 2008
5 copyright : (C) 2008-2020 by Marek Vavruša / libftdi developers
6 email : opensource@intra2net.com and marek@vavrusa.com
7 ***************************************************************************/
8/*
9Copyright (C) 2008-2017 by Marek Vavruša / libftdi developers
10
11The software in this package is distributed under the GNU General
12Public License version 2 (with a special exception described below).
13
14A copy of GNU General Public License (GPL) is included in this distribution,
15in the file COPYING.GPL.
16
17As a special exception, if other files instantiate templates or use macros
18or inline functions from this file, or you compile this file and link it
19with other works to produce a work based on this file, this file
20does not by itself cause the resulting work to be covered
21by the GNU General Public License.
22
23However the source code for this file must still be made available
24in accordance with section (3) of the GNU General Public License.
25
26This exception does not invalidate any other reasons why a work based
27on this file might be covered by the GNU General Public License.
28*/
29#include <libusb.h>
30#define _FTDI_DISABLE_DEPRECATED
31#include "ftdi.hpp"
32#include "ftdi_i.h"
33#include "ftdi.h"
34
35namespace Ftdi
36{
37
39{
40public:
42 : open(false), ftdi(0), dev(0)
43 {
44 ftdi = ftdi_new();
45 }
46
48 {
49 if (open)
51
53 }
54
55 bool open;
56
58 struct libusb_device* dev;
59
60 std::string vendor;
61 std::string description;
62 std::string serial;
63};
64
68 : d( new Private() )
69{
70}
71
75{
76}
77
79{
80 return d->open;
81}
82
83int Context::open(int vendor, int product)
84{
85 // Open device
86 int ret = ftdi_usb_open(d->ftdi, vendor, product);
87
88 if (ret < 0)
89 return ret;
90
91 return get_strings_and_reopen(false,false,false);
92}
93
94int Context::open(int vendor, int product, const std::string& description, const std::string& serial, unsigned int index)
95{
96 // translate empty strings to NULL
97 // -> do not use them to find the device (vs. require an empty string to be set in the EEPROM)
98 const char* c_description=NULL;
99 const char* c_serial=NULL;
100 if (!description.empty())
101 c_description=description.c_str();
102 if (!serial.empty())
103 c_serial=serial.c_str();
104
105 int ret = ftdi_usb_open_desc_index(d->ftdi, vendor, product, c_description, c_serial, index);
106
107 if (ret < 0)
108 return ret;
109
110 return get_strings_and_reopen(false,!description.empty(),!serial.empty());
111}
112
113int Context::open(const std::string& description)
114{
115 int ret = ftdi_usb_open_string(d->ftdi, description.c_str());
116
117 if (ret < 0)
118 return ret;
119
120 return get_strings_and_reopen(false,true,false);
121}
122
123int Context::open(struct libusb_device *dev)
124{
125 if (dev != 0)
126 d->dev = dev;
127
128 if (d->dev == 0)
129 return -1;
130
131 return get_strings_and_reopen();
132}
133
135{
136 d->open = false;
137 d->dev = 0;
138 return ftdi_usb_close(d->ftdi);
139}
140
142{
143 return ftdi_usb_reset(d->ftdi);
144}
145
146int Context::flush(int mask)
147{
148 int ret;
149
150 switch (mask & (Input | Output)) {
151 case Input:
152 ret = ftdi_usb_purge_rx_buffer(d->ftdi);
153 break;
154
155 case Output:
156 ret = ftdi_usb_purge_tx_buffer(d->ftdi);
157 break;
158
159 case Input | Output:
160 ret = ftdi_usb_purge_buffers(d->ftdi);
161 break;
162
163 default:
164 // Emulate behavior of previous version.
165 ret = 1;
166 break;
167 }
168
169 return ret;
170}
171
172int Context::tcflush(int mask)
173{
174 int ret;
175
176 switch (mask & (Input | Output)) {
177 case Input:
178 ret = ftdi_tciflush(d->ftdi);
179 break;
180
181 case Output:
182 ret = ftdi_tcoflush(d->ftdi);
183 break;
184
185 case Input | Output:
186 ret = ftdi_tcioflush(d->ftdi);
187 break;
188
189 default:
190 // Emulate behavior of previous version.
191 ret = 1;
192 break;
193 }
194
195 return ret;
196}
197
199{
200 return ftdi_set_interface(d->ftdi, interface);
201}
202
203void Context::set_usb_device(struct libusb_device_handle *dev)
204{
205 ftdi_set_usbdev(d->ftdi, dev);
206 d->dev = libusb_get_device(dev);
207}
208
209int Context::set_baud_rate(int baudrate)
210{
211 return ftdi_set_baudrate(d->ftdi, baudrate);
212}
213
215{
216 return ftdi_set_line_property(d->ftdi, bits, sbit, parity);
217}
218
220{
221 return ftdi_set_line_property2(d->ftdi, bits, sbit, parity, break_type);
222}
223
225{
226 return d->ftdi->usb_read_timeout;
227}
228
229void Context::set_usb_read_timeout(int usb_read_timeout)
230{
231 d->ftdi->usb_read_timeout = usb_read_timeout;
232}
233
235{
236 return d->ftdi->usb_write_timeout;
237}
238
239void Context::set_usb_write_timeout(int usb_write_timeout)
240{
241 d->ftdi->usb_write_timeout = usb_write_timeout;
242}
243
244int Context::read(unsigned char *buf, int size)
245{
246 return ftdi_read_data(d->ftdi, buf, size);
247}
248
249int Context::set_read_chunk_size(unsigned int chunksize)
250{
251 return ftdi_read_data_set_chunksize(d->ftdi, chunksize);
252}
253
255{
256 unsigned chunk = -1;
257 if (ftdi_read_data_get_chunksize(d->ftdi, &chunk) < 0)
258 return -1;
259
260 return chunk;
261}
262
263int Context::write(const unsigned char *buf, int size)
264{
265 return ftdi_write_data(d->ftdi, buf, size);
266}
267
268int Context::set_write_chunk_size(unsigned int chunksize)
269{
270 return ftdi_write_data_set_chunksize(d->ftdi, chunksize);
271}
272
274{
275 unsigned chunk = -1;
276 if (ftdi_write_data_get_chunksize(d->ftdi, &chunk) < 0)
277 return -1;
278
279 return chunk;
280}
281
283{
284 return ftdi_setflowctrl(d->ftdi, flowctrl);
285}
286
288{
289 int dtr = 0, rts = 0;
290
291 if (mask & Dtr)
292 dtr = 1;
293 if (mask & Rts)
294 rts = 1;
295
296 return ftdi_setdtr_rts(d->ftdi, dtr, rts);
297}
298
299int Context::set_dtr(bool state)
300{
301 return ftdi_setdtr(d->ftdi, state);
302}
303
304int Context::set_rts(bool state)
305{
306 return ftdi_setrts(d->ftdi, state);
307}
308
309int Context::set_latency(unsigned char latency)
310{
311 return ftdi_set_latency_timer(d->ftdi, latency);
312}
313
315{
316 unsigned char latency = 0;
318 return latency;
319}
320
322{
323 unsigned short status = 0;
324 ftdi_poll_modem_status(d->ftdi, &status);
325 return status;
326}
327
328int Context::set_event_char(unsigned char eventch, unsigned char enable)
329{
330 return ftdi_set_event_char(d->ftdi, eventch, enable);
331}
332
333int Context::set_error_char(unsigned char errorch, unsigned char enable)
334{
335 return ftdi_set_error_char(d->ftdi, errorch, enable);
336}
337
338int Context::set_bitmode(unsigned char bitmask, unsigned char mode)
339{
340 return ftdi_set_bitmode(d->ftdi, bitmask, mode);
341}
342
343int Context::set_bitmode(unsigned char bitmask, enum ftdi_mpsse_mode mode)
344{
345 return ftdi_set_bitmode(d->ftdi, bitmask, mode);
346}
347
349{
350 return ftdi_disable_bitbang(d->ftdi);
351}
352
353int Context::read_pins(unsigned char *pins)
354{
355 return ftdi_read_pins(d->ftdi, pins);
356}
357
359{
360 return ftdi_get_error_string(d->ftdi);
361}
362
363int Context::get_strings(bool vendor, bool description, bool serial)
364{
365 // Prepare buffers
366 char ivendor[512], idesc[512], iserial[512];
367
368 int ret = ftdi_usb_get_strings(d->ftdi, d->dev, vendor?ivendor:NULL, 512, description?idesc:NULL, 512, serial?iserial:NULL, 512);
369
370 if (ret < 0)
371 return -1;
372
373 d->vendor = ivendor;
374 d->description = idesc;
375 d->serial = iserial;
376
377 return 1;
378}
379
380int Context::get_strings_and_reopen(bool vendor, bool description, bool serial)
381{
382 int ret = 0;
383
384 if(vendor || description || serial)
385 {
386 if (d->dev == 0)
387 {
388 d->dev = libusb_get_device(d->ftdi->usb_dev);
389 }
390
391 // Get device strings (closes device)
393 if (ret < 0)
394 {
395 d->open = 0;
396 return ret;
397 }
398
399 // Reattach device
400 ret = ftdi_usb_open_dev(d->ftdi, d->dev);
401 d->open = (ret >= 0);
402 }
403
404 return ret;
405}
406
409const std::string& Context::vendor()
410{
411 if(d->vendor.empty())
412 get_strings_and_reopen(true,false,false);
413 return d->vendor;
414}
415
418const std::string& Context::description()
419{
420 if(d->description.empty())
421 get_strings_and_reopen(false,true,false);
422 return d->description;
423}
424
427const std::string& Context::serial()
428{
429 if(d->serial.empty())
430 get_strings_and_reopen(false,false,true);
431 return d->serial;
432}
433
435{
436 ftdi_free(d->ftdi);
437 d->ftdi = context;
438}
439
440void Context::set_usb_device(struct libusb_device *dev)
441{
442 d->dev = dev;
443}
444
446{
447 return d->ftdi;
448}
449
451{
452public:
454 : context(0)
455 {}
456
459};
460
462 : d ( new Private() )
463{
464 d->context = parent->context();
465}
466
468{
469}
470
471int Eeprom::init_defaults(char* manufacturer, char *product, char * serial)
472{
473 return ftdi_eeprom_initdefaults(d->context, manufacturer, product, serial);
474}
475
476int Eeprom::chip_id(unsigned int *chipid)
477{
478 return ftdi_read_chipid(d->context, chipid);
479}
480
481int Eeprom::build(unsigned char *output)
482{
483 return ftdi_eeprom_build(d->context);
484}
485
486int Eeprom::read(unsigned char *eeprom)
487{
488 return ftdi_read_eeprom(d->context);
489}
490
491int Eeprom::write(unsigned char *eeprom)
492{
493 return ftdi_write_eeprom(d->context);
494}
495
496int Eeprom::read_location(int eeprom_addr, unsigned short *eeprom_val)
497{
498 return ftdi_read_eeprom_location(d->context, eeprom_addr, eeprom_val);
499}
500
501int Eeprom::write_location(int eeprom_addr, unsigned short eeprom_val)
502{
503 return ftdi_write_eeprom_location(d->context, eeprom_addr, eeprom_val);
504}
505
507{
508 return ftdi_erase_eeprom(d->context);
509}
510
512{
513public:
514 Private(struct ftdi_device_list* _devlist)
515 : devlist(_devlist)
516 {}
517
519 {
520 if(devlist)
522 }
523
524 std::list<Context> list;
526};
527
529 : d( new Private(devlist) )
530{
531 if (devlist != 0)
532 {
533 // Iterate list
534 for (; devlist != 0; devlist = devlist->next)
535 {
536 Context c;
537 c.set_usb_device(devlist->dev);
538 c.get_strings();
539 d->list.push_back(c);
540 }
541 }
542}
543
545{
546}
547
553{
554 return d->list.begin();
555}
556
562{
563 return d->list.end();
564}
565
571{
572 return d->list.begin();
573}
574
580{
581 return d->list.end();
582}
583
589{
590 return d->list.rbegin();
591}
592
598{
599 return d->list.rend();
600}
601
607{
608 return d->list.rbegin();
609}
610
616{
617 return d->list.rend();
618
619}
620
625List::ListType::size_type List::size() const
626{
627 return d->list.size();
628}
629
634bool List::empty() const
635{
636 return d->list.empty();
637}
638
645{
646 ListType().swap(d->list);
647
648 // Free device list
649 if (d->devlist)
650 {
651 ftdi_list_free(&d->devlist);
652 d->devlist = 0;
653 }
654}
655
660void List::push_back(const Context& element)
661{
662 d->list.push_back(element);
663}
664
669void List::push_front(const Context& element)
670{
671 d->list.push_front(element);
672}
673
680{
681 return d->list.erase(pos);
682}
683
691{
692 return d->list.erase(beg, end);
693}
694
695List* List::find_all(Context &context, int vendor, int product)
696{
697 struct ftdi_device_list* dlist = 0;
698 ftdi_usb_find_all(context.context(), &dlist, vendor, product);
699 return new List(dlist);
700}
701
702}
std::string vendor
Definition: ftdi.cpp:60
std::string description
Definition: ftdi.cpp:61
std::string serial
Definition: ftdi.cpp:62
struct ftdi_context * ftdi
Definition: ftdi.cpp:57
struct libusb_device * dev
Definition: ftdi.cpp:58
FTDI device context. Represents single FTDI device context.
Definition: ftdi.hpp:48
const char * error_string()
Definition: ftdi.cpp:358
Context()
Constructor.
Definition: ftdi.cpp:67
int set_flow_control(int flowctrl)
Definition: ftdi.cpp:282
int set_baud_rate(int baudrate)
Definition: ftdi.cpp:209
const std::string & description()
Device strings properties.
Definition: ftdi.cpp:418
int read(unsigned char *buf, int size)
Definition: ftdi.cpp:244
int DEPRECATED() flush(int mask=Input|Output)
Definition: ftdi.cpp:146
bool is_open()
Definition: ftdi.cpp:78
int reset()
Definition: ftdi.cpp:141
const std::string & serial()
Device strings properties.
Definition: ftdi.cpp:427
void set_usb_device(struct libusb_device_handle *dev)
Definition: ftdi.cpp:203
void set_usb_write_timeout(int usb_write_timeout)
Definition: ftdi.cpp:239
int get_usb_read_timeout() const
Definition: ftdi.cpp:224
int read_chunk_size()
Definition: ftdi.cpp:254
int set_write_chunk_size(unsigned int chunksize)
Definition: ftdi.cpp:268
int set_error_char(unsigned char errorch, unsigned char enable)
Definition: ftdi.cpp:333
int set_dtr(bool state)
Definition: ftdi.cpp:299
int set_latency(unsigned char latency)
Definition: ftdi.cpp:309
int set_read_chunk_size(unsigned int chunksize)
Definition: ftdi.cpp:249
int tcflush(int mask=Input|Output)
Definition: ftdi.cpp:172
int open(struct libusb_device *dev=0)
Definition: ftdi.cpp:123
int set_event_char(unsigned char eventch, unsigned char enable)
Definition: ftdi.cpp:328
unsigned latency()
Definition: ftdi.cpp:314
unsigned short poll_modem_status()
Definition: ftdi.cpp:321
int set_interface(enum ftdi_interface interface)
Definition: ftdi.cpp:198
int get_strings(bool vendor=true, bool description=true, bool serial=true)
Definition: ftdi.cpp:363
int read_pins(unsigned char *pins)
Definition: ftdi.cpp:353
void set_context(struct ftdi_context *context)
Definition: ftdi.cpp:434
int close()
Definition: ftdi.cpp:134
const std::string & vendor()
Device strings properties.
Definition: ftdi.cpp:409
void set_usb_read_timeout(int usb_read_timeout)
Definition: ftdi.cpp:229
int write(const unsigned char *buf, int size)
Definition: ftdi.cpp:263
int set_line_property(enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity)
Definition: ftdi.cpp:214
int bitbang_disable()
Definition: ftdi.cpp:348
~Context()
Destructor.
Definition: ftdi.cpp:74
int set_modem_control(int mask=Dtr|Rts)
Definition: ftdi.cpp:287
int write_chunk_size()
Definition: ftdi.cpp:273
int set_bitmode(unsigned char bitmask, unsigned char mode)
Definition: ftdi.cpp:338
int set_rts(bool state)
Definition: ftdi.cpp:304
struct ftdi_context * context()
Definition: ftdi.cpp:445
int get_strings_and_reopen(bool vendor=true, bool description=true, bool serial=true)
Definition: ftdi.cpp:380
int get_usb_write_timeout() const
Definition: ftdi.cpp:234
struct ftdi_context * context
Definition: ftdi.cpp:458
struct ftdi_eeprom eeprom
Definition: ftdi.cpp:457
int erase()
Definition: ftdi.cpp:506
int read(unsigned char *eeprom)
Definition: ftdi.cpp:486
int init_defaults(char *manufacturer, char *product, char *serial)
Definition: ftdi.cpp:471
Eeprom(Context *parent)
Definition: ftdi.cpp:461
int write_location(int eeprom_addr, unsigned short eeprom_val)
Definition: ftdi.cpp:501
int read_location(int eeprom_addr, unsigned short *eeprom_val)
Definition: ftdi.cpp:496
int build(unsigned char *output)
Definition: ftdi.cpp:481
int write(unsigned char *eeprom)
Definition: ftdi.cpp:491
int chip_id(unsigned int *chipid)
Definition: ftdi.cpp:476
Private(struct ftdi_device_list *_devlist)
Definition: ftdi.cpp:514
struct ftdi_device_list * devlist
Definition: ftdi.cpp:525
std::list< Context > list
Definition: ftdi.cpp:524
Device list.
Definition: ftdi.hpp:177
std::list< Context > ListType
List type storing "Context" objects.
Definition: ftdi.hpp:185
void push_back(const Context &element)
Definition: ftdi.cpp:660
void clear()
Definition: ftdi.cpp:644
ListType::const_reverse_iterator const_reverse_iterator
Const reverse iterator type for the container.
Definition: ftdi.hpp:193
iterator begin()
Definition: ftdi.cpp:552
ListType::iterator iterator
Iterator type for the container.
Definition: ftdi.hpp:187
ListType::reverse_iterator reverse_iterator
Reverse iterator type for the container.
Definition: ftdi.hpp:191
iterator erase(iterator pos)
Definition: ftdi.cpp:679
reverse_iterator rbegin()
Definition: ftdi.cpp:588
ListType::const_iterator const_iterator
Const iterator type for the container.
Definition: ftdi.hpp:189
bool empty() const
Definition: ftdi.cpp:634
List(struct ftdi_device_list *devlist=0)
Definition: ftdi.cpp:528
iterator end()
Definition: ftdi.cpp:561
reverse_iterator rend()
Definition: ftdi.cpp:597
static List * find_all(Context &context, int vendor, int product)
Definition: ftdi.cpp:695
void push_front(const Context &element)
Definition: ftdi.cpp:669
ListType::size_type size() const
Definition: ftdi.cpp:625
int ftdi_write_data(struct ftdi_context *ftdi, const unsigned char *buf, int size)
Definition: ftdi.c:1583
int ftdi_set_line_property(struct ftdi_context *ftdi, enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity)
Definition: ftdi.c:1494
int ftdi_usb_open_dev(struct ftdi_context *ftdi, libusb_device *dev)
Definition: ftdi.c:589
int ftdi_eeprom_initdefaults(struct ftdi_context *ftdi, char *manufacturer, char *product, char *serial)
Definition: ftdi.c:2579
int ftdi_usb_get_strings(struct ftdi_context *ftdi, struct libusb_device *dev, char *manufacturer, int mnf_len, char *description, int desc_len, char *serial, int serial_len)
Definition: ftdi.c:413
int ftdi_usb_purge_tx_buffer(struct ftdi_context *ftdi)
Definition: ftdi.c:1113
void ftdi_set_usbdev(struct ftdi_context *ftdi, libusb_device_handle *usb)
Definition: ftdi.c:272
int ftdi_usb_purge_rx_buffer(struct ftdi_context *ftdi)
Definition: ftdi.c:1060
int ftdi_erase_eeprom(struct ftdi_context *ftdi)
Definition: ftdi.c:4669
int ftdi_usb_reset(struct ftdi_context *ftdi)
Definition: ftdi.c:1003
int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devlist, int vendor, int product)
Definition: ftdi.c:314
int ftdi_usb_purge_buffers(struct ftdi_context *ftdi)
Definition: ftdi.c:1168
void ftdi_list_free(struct ftdi_device_list **devlist)
Definition: ftdi.c:362
int ftdi_tciflush(struct ftdi_context *ftdi)
Definition: ftdi.c:1030
int ftdi_poll_modem_status(struct ftdi_context *ftdi, unsigned short *status)
Definition: ftdi.c:2347
int ftdi_usb_open_desc_index(struct ftdi_context *ftdi, int vendor, int product, const char *description, const char *serial, unsigned int index)
Definition: ftdi.c:764
void ftdi_free(struct ftdi_context *ftdi)
Definition: ftdi.c:260
int ftdi_set_latency_timer(struct ftdi_context *ftdi, unsigned char latency)
Definition: ftdi.c:2266
int ftdi_disable_bitbang(struct ftdi_context *ftdi)
Definition: ftdi.c:2217
int ftdi_setdtr(struct ftdi_context *ftdi, int state)
Definition: ftdi.c:2423
int ftdi_set_line_property2(struct ftdi_context *ftdi, enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity, enum ftdi_break_type break_type)
Definition: ftdi.c:1513
int ftdi_setrts(struct ftdi_context *ftdi, int state)
Definition: ftdi.c:2453
int ftdi_write_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize)
Definition: ftdi.c:1983
int ftdi_setdtr_rts(struct ftdi_context *ftdi, int dtr, int rts)
Definition: ftdi.c:2484
int ftdi_write_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, unsigned short eeprom_val)
Definition: ftdi.c:4558
int ftdi_read_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, unsigned short *eeprom_val)
Definition: ftdi.c:4437
int ftdi_read_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize)
Definition: ftdi.c:2133
int ftdi_set_interface(struct ftdi_context *ftdi, enum ftdi_interface interface)
Definition: ftdi.c:161
int ftdi_set_event_char(struct ftdi_context *ftdi, unsigned char eventch, unsigned char enable)
Definition: ftdi.c:2520
int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size)
Definition: ftdi.c:2007
int ftdi_set_bitmode(struct ftdi_context *ftdi, unsigned char bitmask, unsigned char mode)
Definition: ftdi.c:2191
const char * ftdi_get_error_string(struct ftdi_context *ftdi)
Definition: ftdi.c:4731
int ftdi_write_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize)
Definition: ftdi.c:1965
int ftdi_write_eeprom(struct ftdi_context *ftdi)
Definition: ftdi.c:4614
int ftdi_usb_close(struct ftdi_context *ftdi)
Definition: ftdi.c:1197
int ftdi_usb_open(struct ftdi_context *ftdi, int vendor, int product)
Definition: ftdi.c:707
int ftdi_usb_open_string(struct ftdi_context *ftdi, const char *description)
Definition: ftdi.c:910
int ftdi_read_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize)
Definition: ftdi.c:2170
struct ftdi_context * ftdi_new(void)
Definition: ftdi.c:132
int ftdi_tcoflush(struct ftdi_context *ftdi)
Definition: ftdi.c:1087
int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins)
Definition: ftdi.c:2240
int ftdi_read_chipid(struct ftdi_context *ftdi, unsigned int *chipid)
Definition: ftdi.c:4520
int ftdi_read_eeprom(struct ftdi_context *ftdi)
Definition: ftdi.c:4461
int ftdi_setflowctrl(struct ftdi_context *ftdi, int flowctrl)
Definition: ftdi.c:2375
int ftdi_eeprom_build(struct ftdi_context *ftdi)
Definition: ftdi.c:2910
int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency)
Definition: ftdi.c:2293
int ftdi_set_baudrate(struct ftdi_context *ftdi, int baudrate)
Definition: ftdi.c:1448
int ftdi_set_error_char(struct ftdi_context *ftdi, unsigned char errorch, unsigned char enable)
Definition: ftdi.c:2549
int ftdi_tcioflush(struct ftdi_context *ftdi)
Definition: ftdi.c:1137
ftdi_mpsse_mode
Definition: ftdi.h:68
ftdi_stopbits_type
Definition: ftdi.h:60
ftdi_bits_type
Definition: ftdi.h:62
ftdi_interface
Definition: ftdi.h:83
ftdi_parity_type
Definition: ftdi.h:58
ftdi_break_type
Definition: ftdi.h:64
Definition: ftdi.cpp:36
Main context structure for all libftdi functions.
Definition: ftdi.h:272
struct ftdi_eeprom * eeprom
Definition: ftdi.h:317
list of usb devices created by ftdi_usb_find_all()
Definition: ftdi.h:395
struct ftdi_device_list * next
Definition: ftdi.h:397
struct libusb_device * dev
Definition: ftdi.h:399
FTDI eeprom structure.
Definition: ftdi_i.h:32