<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>libftdi: ftdi.hpp Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <h1>ftdi.hpp</h1> </div> </div> <div class="contents"> <a href="ftdi_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/***************************************************************************</span> <a name="l00002"></a>00002 <span class="comment"> ftdi.hpp - C++ wrapper for libftdi</span> <a name="l00003"></a>00003 <span class="comment"> -------------------</span> <a name="l00004"></a>00004 <span class="comment"> begin : Mon Oct 13 2008</span> <a name="l00005"></a>00005 <span class="comment"> copyright : (C) 2008 by Marek Vavruša</span> <a name="l00006"></a>00006 <span class="comment"> email : opensource@intra2net.com and marek@vavrusa.com</span> <a name="l00007"></a>00007 <span class="comment"> ***************************************************************************/</span> <a name="l00008"></a>00008 <span class="comment">/*</span> <a name="l00009"></a>00009 <span class="comment">Copyright (C) 2008 by Marek Vavruša</span> <a name="l00010"></a>00010 <span class="comment"></span> <a name="l00011"></a>00011 <span class="comment">The software in this package is distributed under the GNU General</span> <a name="l00012"></a>00012 <span class="comment">Public License version 2 (with a special exception described below).</span> <a name="l00013"></a>00013 <span class="comment"></span> <a name="l00014"></a>00014 <span class="comment">A copy of GNU General Public License (GPL) is included in this distribution,</span> <a name="l00015"></a>00015 <span class="comment">in the file COPYING.GPL.</span> <a name="l00016"></a>00016 <span class="comment"></span> <a name="l00017"></a>00017 <span class="comment">As a special exception, if other files instantiate templates or use macros</span> <a name="l00018"></a>00018 <span class="comment">or inline functions from this file, or you compile this file and link it</span> <a name="l00019"></a>00019 <span class="comment">with other works to produce a work based on this file, this file</span> <a name="l00020"></a>00020 <span class="comment">does not by itself cause the resulting work to be covered</span> <a name="l00021"></a>00021 <span class="comment">by the GNU General Public License.</span> <a name="l00022"></a>00022 <span class="comment"></span> <a name="l00023"></a>00023 <span class="comment">However the source code for this file must still be made available</span> <a name="l00024"></a>00024 <span class="comment">in accordance with section (3) of the GNU General Public License.</span> <a name="l00025"></a>00025 <span class="comment"></span> <a name="l00026"></a>00026 <span class="comment">This exception does not invalidate any other reasons why a work based</span> <a name="l00027"></a>00027 <span class="comment">on this file might be covered by the GNU General Public License.</span> <a name="l00028"></a>00028 <span class="comment">*/</span> <a name="l00029"></a>00029 <span class="preprocessor">#ifndef __libftdi_hpp__</span> <a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define __libftdi_hpp__</span> <a name="l00031"></a>00031 <span class="preprocessor"></span> <a name="l00032"></a>00032 <span class="preprocessor">#include <list></span> <a name="l00033"></a>00033 <span class="preprocessor">#include <string></span> <a name="l00034"></a>00034 <span class="preprocessor">#include <boost/shared_ptr.hpp></span> <a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="ftdi_8h.html">ftdi.h</a>"</span> <a name="l00036"></a>00036 <a name="l00037"></a>00037 <span class="keyword">namespace </span>Ftdi <a name="l00038"></a>00038 { <a name="l00039"></a>00039 <a name="l00040"></a>00040 <span class="comment">/* Forward declarations*/</span> <a name="l00041"></a>00041 <span class="keyword">class </span>List; <a name="l00042"></a>00042 <span class="keyword">class </span>Eeprom; <a name="l00043"></a>00043 <a name="l00047"></a><a class="code" href="classFtdi_1_1Context.html">00047</a> <span class="keyword">class </span><a class="code" href="classFtdi_1_1Context.html" title="FTDI device context. Represents single FTDI device context.">Context</a> <a name="l00048"></a>00048 { <a name="l00049"></a>00049 <span class="comment">/* Friends */</span> <a name="l00050"></a><a class="code" href="classFtdi_1_1Context.html#a473938987b94c05a6ac5c45fb65eb12a">00050</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classFtdi_1_1Eeprom.html" title="Device EEPROM.">Eeprom</a>; <a name="l00051"></a><a class="code" href="classFtdi_1_1Context.html#a8cee552d09eaeb60a09d95309a87b498">00051</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classFtdi_1_1List.html" title="Device list.">List</a>; <a name="l00052"></a>00052 <a name="l00053"></a>00053 <span class="keyword">public</span>: <a name="l00056"></a><a class="code" href="classFtdi_1_1Context.html#a608e9a5f5e023ab5f14ba6d21ce9fed9">00056</a> <span class="keyword">enum</span> <a class="code" href="classFtdi_1_1Context.html#a608e9a5f5e023ab5f14ba6d21ce9fed9" title="Direction flags for flush().">Direction</a> <a name="l00057"></a>00057 { <a name="l00058"></a><a class="code" href="classFtdi_1_1Context.html#a608e9a5f5e023ab5f14ba6d21ce9fed9a087f9b8fee592efb3929c382e0804404">00058</a> Input, <a name="l00059"></a><a class="code" href="classFtdi_1_1Context.html#a608e9a5f5e023ab5f14ba6d21ce9fed9a5c3962c84bf153b1837ca2ca8ac97886">00059</a> <a class="code" href="classFtdi_1_1Context.html#a608e9a5f5e023ab5f14ba6d21ce9fed9a5c3962c84bf153b1837ca2ca8ac97886">Output</a> <a name="l00060"></a>00060 }; <a name="l00061"></a>00061 <a name="l00064"></a><a class="code" href="classFtdi_1_1Context.html#ab8cd0b1f5a42a3d2517e804bd3d2c8f1">00064</a> <span class="keyword">enum</span> <a class="code" href="classFtdi_1_1Context.html#ab8cd0b1f5a42a3d2517e804bd3d2c8f1" title="Modem control flags.">ModemCtl</a> <a name="l00065"></a>00065 { <a name="l00066"></a><a class="code" href="classFtdi_1_1Context.html#ab8cd0b1f5a42a3d2517e804bd3d2c8f1a0ed23ea2a691e4398908cb7442377e37">00066</a> Dtr, <a name="l00067"></a><a class="code" href="classFtdi_1_1Context.html#ab8cd0b1f5a42a3d2517e804bd3d2c8f1a7dda31debfdeaf64b64734b881afe109">00067</a> <a class="code" href="classFtdi_1_1Context.html#ab8cd0b1f5a42a3d2517e804bd3d2c8f1a7dda31debfdeaf64b64734b881afe109">Rts</a> <a name="l00068"></a>00068 }; <a name="l00069"></a>00069 <a name="l00070"></a>00070 <span class="comment">/* Constructor, Destructor */</span> <a name="l00071"></a>00071 <a class="code" href="classFtdi_1_1Context.html#a06bd23d6d2d16489cb5abf792f368b8e" title="Constructor.">Context</a>(); <a name="l00072"></a>00072 <a class="code" href="classFtdi_1_1Context.html#ad12a84ca44914ae7c90404881c99503e" title="Destructor.">~Context</a>(); <a name="l00073"></a>00073 <a name="l00074"></a>00074 <span class="comment">/* Properties */</span> <a name="l00075"></a>00075 <a class="code" href="classFtdi_1_1Eeprom.html" title="Device EEPROM.">Eeprom</a>* <a class="code" href="classFtdi_1_1Context.html#a374535a96a9c2144215da6779f700315">eeprom</a>(); <a name="l00076"></a>00076 <span class="keyword">const</span> std::string& <a class="code" href="classFtdi_1_1Context.html#ab1ef11b1851c8234f5305fdfc7421887" title="Device strings properties.">vendor</a>(); <a name="l00077"></a>00077 <span class="keyword">const</span> std::string& <a class="code" href="classFtdi_1_1Context.html#a1851e8cffbb77e7f7ef7adb8fa833962" title="Device strings properties.">description</a>(); <a name="l00078"></a>00078 <span class="keyword">const</span> std::string& <a class="code" href="classFtdi_1_1Context.html#a3d4035444e2f78ff8d7aa37c26236df8" title="Device strings properties.">serial</a>(); <a name="l00079"></a>00079 <a name="l00080"></a>00080 <span class="comment">/* Device manipulators */</span> <a name="l00081"></a>00081 <span class="keywordtype">bool</span> <a class="code" href="classFtdi_1_1Context.html#a3a222cbc0ac54ea699474aa48b8d27cd">is_open</a>(); <a name="l00082"></a>00082 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a25b30dde19d821fe16229c76719ff0cd">open</a>(<span class="keyword">struct</span> usb_device *dev = 0); <a name="l00083"></a>00083 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a25b30dde19d821fe16229c76719ff0cd">open</a>(<span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#ab1ef11b1851c8234f5305fdfc7421887" title="Device strings properties.">vendor</a>, <span class="keywordtype">int</span> product); <a name="l00084"></a>00084 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a25b30dde19d821fe16229c76719ff0cd">open</a>(<span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#ab1ef11b1851c8234f5305fdfc7421887" title="Device strings properties.">vendor</a>, <span class="keywordtype">int</span> product, <span class="keyword">const</span> std::string& <a class="code" href="classFtdi_1_1Context.html#a1851e8cffbb77e7f7ef7adb8fa833962" title="Device strings properties.">description</a>, <span class="keyword">const</span> std::string& <a class="code" href="classFtdi_1_1Context.html#a3d4035444e2f78ff8d7aa37c26236df8" title="Device strings properties.">serial</a> = std::string(), <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index=0); <a name="l00085"></a>00085 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a25b30dde19d821fe16229c76719ff0cd">open</a>(<span class="keyword">const</span> std::string& description); <a name="l00086"></a>00086 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#aad96d64cfe28b6085e384acdbcfe43fa">close</a>(); <a name="l00087"></a>00087 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a3d318e752b00f0822d6e2c417420afde">reset</a>(); <a name="l00088"></a>00088 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a36cf5e632dcc34f4ccd37a02eeedcb8d">flush</a>(<span class="keywordtype">int</span> mask = <a class="code" href="classFtdi_1_1Context.html#a608e9a5f5e023ab5f14ba6d21ce9fed9a087f9b8fee592efb3929c382e0804404">Input</a>|<a class="code" href="classFtdi_1_1Context.html#a608e9a5f5e023ab5f14ba6d21ce9fed9a5c3962c84bf153b1837ca2ca8ac97886">Output</a>); <a name="l00089"></a>00089 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a9baf46935760b09ba2f06cd978d83a41">set_interface</a>(<span class="keyword">enum</span> <a class="code" href="ftdi_8h.html#a9c55e66c45a0e4ec5548ee7d6e1a9265">ftdi_interface</a> interface); <a name="l00090"></a>00090 <span class="keywordtype">void</span> <a class="code" href="classFtdi_1_1Context.html#a42107660d1baa13a1229ca819859f662">set_usb_device</a>(<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *dev); <a name="l00091"></a>00091 <a name="l00092"></a>00092 <span class="comment">/* Line manipulators */</span> <a name="l00093"></a>00093 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a12d1736e590aefe7a4a3880d01961a20">set_baud_rate</a>(<span class="keywordtype">int</span> baudrate); <a name="l00094"></a>00094 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#acaf9f3ab2dde7b231e26cd35db4a962c">set_line_property</a>(<span class="keyword">enum</span> <a class="code" href="ftdi_8h.html#a8007a7d5e37b76307c341051769e5c6f">ftdi_bits_type</a> bits, <span class="keyword">enum</span> <a class="code" href="ftdi_8h.html#a3977a883c99069e02f97e99d059dc8b8">ftdi_stopbits_type</a> sbit, <span class="keyword">enum</span> <a class="code" href="ftdi_8h.html#ab0a93b5355c5155dd4fbd5beaf5d5e1d">ftdi_parity_type</a> parity); <a name="l00095"></a>00095 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#acaf9f3ab2dde7b231e26cd35db4a962c">set_line_property</a>(<span class="keyword">enum</span> <a class="code" href="ftdi_8h.html#a8007a7d5e37b76307c341051769e5c6f">ftdi_bits_type</a> bits, <span class="keyword">enum</span> <a class="code" href="ftdi_8h.html#a3977a883c99069e02f97e99d059dc8b8">ftdi_stopbits_type</a> sbit, <span class="keyword">enum</span> <a class="code" href="ftdi_8h.html#ab0a93b5355c5155dd4fbd5beaf5d5e1d">ftdi_parity_type</a> parity, <span class="keyword">enum</span> <a class="code" href="ftdi_8h.html#ae1ca6c6246df33380443c4ba6f192025">ftdi_break_type</a> break_type); <a name="l00096"></a>00096 <a name="l00097"></a>00097 <span class="comment">/* I/O */</span> <a name="l00098"></a>00098 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a1858062c4dacda2ab8271cd51550b7ee">read</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> size); <a name="l00099"></a>00099 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a5cb1b4266a68f3bd9133e52178042ddf">write</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> size); <a name="l00100"></a>00100 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a6e4b4df1cd2c0786b94620b4e5b2f80f">set_read_chunk_size</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> chunksize); <a name="l00101"></a>00101 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a54859d31d5177488aefa95067c8d4666">set_write_chunk_size</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> chunksize); <a name="l00102"></a>00102 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a4c482b031ffe04b12087e573e91e4b79">read_chunk_size</a>(); <a name="l00103"></a>00103 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#ad4500d40d2bd07f383724968ffa945a2">write_chunk_size</a>(); <a name="l00104"></a>00104 <a name="l00105"></a>00105 <span class="comment">/* Async IO</span> <a name="l00106"></a>00106 <span class="comment"> TODO: should wrap?</span> <a name="l00107"></a>00107 <span class="comment"> int writeAsync(unsigned char *buf, int size);</span> <a name="l00108"></a>00108 <span class="comment"> void asyncComplete(int wait_for_more);</span> <a name="l00109"></a>00109 <span class="comment"> */</span> <a name="l00110"></a>00110 <a name="l00111"></a>00111 <span class="comment">/* Flow control */</span> <a name="l00112"></a>00112 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a7471fc6635a9ff2f98d30c5830eb7593">set_event_char</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> eventch, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> enable); <a name="l00113"></a>00113 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a5b846e30bb38c78fd772281be7fc342b">set_error_char</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> errorch, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> enable); <a name="l00114"></a>00114 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a0c29fde1904335a1213ce1e1982adc24">set_flow_control</a>(<span class="keywordtype">int</span> flowctrl); <a name="l00115"></a>00115 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#ad1968faa8b41f6c49c70a55872a6bdbc">set_modem_control</a>(<span class="keywordtype">int</span> mask = <a class="code" href="classFtdi_1_1Context.html#ab8cd0b1f5a42a3d2517e804bd3d2c8f1a0ed23ea2a691e4398908cb7442377e37">Dtr</a>|<a class="code" href="classFtdi_1_1Context.html#ab8cd0b1f5a42a3d2517e804bd3d2c8f1a7dda31debfdeaf64b64734b881afe109">Rts</a>); <a name="l00116"></a>00116 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a60ebdaac48d273b925ff35c510f3c19a">set_latency</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="classFtdi_1_1Context.html#a7e87873dc7c2987cd588f4f4d72e7732">latency</a>); <a name="l00117"></a>00117 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a5f05bf405868e37d2efe50afaf377706">set_dtr</a>(<span class="keywordtype">bool</span> state); <a name="l00118"></a>00118 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#ae5e60eb0188ba8039ee7b50329779cb0">set_rts</a>(<span class="keywordtype">bool</span> state); <a name="l00119"></a>00119 <a name="l00120"></a>00120 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="classFtdi_1_1Context.html#a9204d8315dd586286535da2a68917dad">poll_modem_status</a>(); <a name="l00121"></a>00121 <span class="keywordtype">unsigned</span> <a class="code" href="classFtdi_1_1Context.html#a7e87873dc7c2987cd588f4f4d72e7732">latency</a>(); <a name="l00122"></a>00122 <a name="l00123"></a>00123 <span class="comment">/* BitBang mode */</span> <a name="l00124"></a>00124 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#ad8a0a54d23eb0f6b8b3c77155c1b4487">set_bitmode</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> bitmask, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> mode); <a name="l00125"></a>00125 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#ad8a0a54d23eb0f6b8b3c77155c1b4487">set_bitmode</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> bitmask, <span class="keyword">enum</span> <a class="code" href="ftdi_8h.html#a2250f7812c87a96ada7fd4f19b82f666">ftdi_mpsse_mode</a> mode); <a name="l00126"></a>00126 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#ac29e89c1b9d5133ff9912ffea72eaf8c">DEPRECATED</a>(bitbang_enable(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> bitmask)); <a name="l00127"></a>00127 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#ace0a0738c511bf041a456b94ca096ec9">bitbang_disable</a>(); <a name="l00128"></a>00128 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#aa41e612799358ce70b4a5003ebcfe9ec">read_pins</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pins); <a name="l00129"></a>00129 <a name="l00130"></a>00130 <span class="comment">/* Misc */</span> <a name="l00131"></a>00131 <span class="keywordtype">char</span>* <a class="code" href="classFtdi_1_1Context.html#ab4e06e0e4bf156c0c5421ec0bbb4cdd1">error_string</a>(); <a name="l00132"></a>00132 <a name="l00133"></a>00133 <span class="keyword">protected</span>: <a name="l00134"></a>00134 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#aaaf4d528fe4d70502b14582702103db8">get_strings</a>(); <a name="l00135"></a>00135 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Context.html#a6fa719a467db132076e752dd45223dbe">get_strings_and_reopen</a>(); <a name="l00136"></a>00136 <a name="l00137"></a>00137 <span class="comment">/* Properties */</span> <a name="l00138"></a>00138 <span class="keyword">struct </span><a class="code" href="structftdi__context.html" title="Main context structure for all libftdi functions.">ftdi_context</a>* <a class="code" href="classFtdi_1_1Context.html#ae7cb8331c5eab1d7aa4ade40a1bd5b9e">context</a>(); <a name="l00139"></a>00139 <span class="keywordtype">void</span> <a class="code" href="classFtdi_1_1Context.html#aaac96a16870d29bb7f59353a36524a39">set_context</a>(<span class="keyword">struct</span> <a class="code" href="structftdi__context.html" title="Main context structure for all libftdi functions.">ftdi_context</a>* <a class="code" href="classFtdi_1_1Context.html#ae7cb8331c5eab1d7aa4ade40a1bd5b9e">context</a>); <a name="l00140"></a>00140 <span class="keywordtype">void</span> <a class="code" href="classFtdi_1_1Context.html#a42107660d1baa13a1229ca819859f662">set_usb_device</a>(<span class="keyword">struct</span> usb_device *dev); <a name="l00141"></a>00141 <a name="l00142"></a>00142 <span class="keyword">private</span>: <a name="l00143"></a>00143 <span class="keyword">class </span>Private; <a name="l00144"></a>00144 boost::shared_ptr<Private> d; <a name="l00145"></a>00145 }; <a name="l00146"></a>00146 <a name="l00149"></a><a class="code" href="classFtdi_1_1Eeprom.html">00149</a> <span class="keyword">class </span><a class="code" href="classFtdi_1_1Eeprom.html" title="Device EEPROM.">Eeprom</a> <a name="l00150"></a>00150 { <a name="l00151"></a>00151 <span class="keyword">public</span>: <a name="l00152"></a>00152 <a class="code" href="classFtdi_1_1Eeprom.html#a7ecd3ee3bb235d7d9c32b5287f509edc">Eeprom</a>(<a class="code" href="classFtdi_1_1Context.html" title="FTDI device context. Represents single FTDI device context.">Context</a>* parent); <a name="l00153"></a>00153 <a class="code" href="classFtdi_1_1Eeprom.html#ae7945809c4ff06b8bd386472eed26b1e">~Eeprom</a>(); <a name="l00154"></a>00154 <a name="l00155"></a>00155 <span class="keywordtype">void</span> <a class="code" href="classFtdi_1_1Eeprom.html#ab8eca942c0bdbee8a1b67910857f1ea0">init_defaults</a>(); <a name="l00156"></a>00156 <span class="keywordtype">void</span> <a class="code" href="classFtdi_1_1Eeprom.html#a3f6fc32b69a68b190b03bc4e3c4b8810">set_size</a>(<span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Eeprom.html#aeeb5331e185e8e6c24ad0baf5c851276">size</a>); <a name="l00157"></a>00157 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Eeprom.html#aeeb5331e185e8e6c24ad0baf5c851276">size</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *eeprom, <span class="keywordtype">int</span> maxsize); <a name="l00158"></a>00158 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Eeprom.html#af7ab5af427de9c7464f11f1ec784c4da">chip_id</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *chipid); <a name="l00159"></a>00159 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Eeprom.html#abddb318d9df2c626fffa09047d5ab549">build</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *output); <a name="l00160"></a>00160 <a name="l00161"></a>00161 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Eeprom.html#a59ef82e22828370274fa7de627eff2e4">read</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *eeprom); <a name="l00162"></a>00162 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Eeprom.html#ac6fb73bd70749209c46bdd9529344392">write</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *eeprom); <a name="l00163"></a>00163 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Eeprom.html#aacdb0d74cceaeae77b754232c8b68f9e">read_location</a>(<span class="keywordtype">int</span> eeprom_addr, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> *eeprom_val); <a name="l00164"></a>00164 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Eeprom.html#aaa79973c9fa5c44e041ad416860fa1b8">write_location</a>(<span class="keywordtype">int</span> eeprom_addr, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> eeprom_val); <a name="l00165"></a>00165 <span class="keywordtype">int</span> <a class="code" href="classFtdi_1_1Eeprom.html#a3044b5cd481ebbefd3c64e4653e8d6f3">erase</a>(); <a name="l00166"></a>00166 <a name="l00167"></a>00167 <span class="keyword">private</span>: <a name="l00168"></a>00168 <span class="keyword">class </span><a class="code" href="classFtdi_1_1Eeprom_1_1Private.html">Private</a>; <a name="l00169"></a>00169 boost::shared_ptr<Private> d; <a name="l00170"></a>00170 }; <a name="l00171"></a>00171 <a name="l00174"></a><a class="code" href="classFtdi_1_1List.html">00174</a> <span class="keyword">class </span><a class="code" href="classFtdi_1_1List.html" title="Device list.">List</a> <a name="l00175"></a>00175 { <a name="l00176"></a>00176 <span class="keyword">public</span>: <a name="l00177"></a>00177 <a class="code" href="classFtdi_1_1List.html#a9f005b9f8886ab85e43a2ea5b019b72d">List</a>(<span class="keyword">struct</span> <a class="code" href="structftdi__device__list.html" title="list of usb devices created by ftdi_usb_find_all()">ftdi_device_list</a>* devlist = 0); <a name="l00178"></a>00178 <a class="code" href="classFtdi_1_1List.html#a0d6814256d82692d46483733c71037d7">~List</a>(); <a name="l00179"></a>00179 <a name="l00180"></a>00180 <span class="keyword">static</span> <a class="code" href="classFtdi_1_1List.html" title="Device list.">List</a>* <a class="code" href="classFtdi_1_1List.html#abd0aa0bf990eb06692863274cfdff6cd">find_all</a>(<span class="keywordtype">int</span> vendor, <span class="keywordtype">int</span> product); <a name="l00181"></a>00181 <a name="l00183"></a><a class="code" href="classFtdi_1_1List.html#a0f7f7fad56e8d14e0b96f9b985a433ad">00183</a> <span class="keyword">typedef</span> std::list<Context> ListType; <a name="l00185"></a><a class="code" href="classFtdi_1_1List.html#a42dc7256a0cacb1534388b272d71a6e1">00185</a> <span class="keyword">typedef</span> ListType::iterator iterator; <a name="l00187"></a><a class="code" href="classFtdi_1_1List.html#a89f81377906bec5c14d262a959ac4bb0">00187</a> <span class="keyword">typedef</span> ListType::const_iterator const_iterator; <a name="l00189"></a><a class="code" href="classFtdi_1_1List.html#a5031c32928ad47f6a8c9b425a557c998">00189</a> <span class="keyword">typedef</span> ListType::reverse_iterator reverse_iterator; <a name="l00191"></a><a class="code" href="classFtdi_1_1List.html#a40ba96ede36bc45a2b22e0a9ceba9cc0">00191</a> <span class="keyword">typedef</span> ListType::const_reverse_iterator const_reverse_iterator; <a name="l00192"></a>00192 <a name="l00193"></a>00193 <a class="code" href="classFtdi_1_1List.html#a42dc7256a0cacb1534388b272d71a6e1" title="Iterator type for the container.">iterator</a> <a class="code" href="classFtdi_1_1List.html#a420ec5202f3c6a12de1b76c4842df42e">begin</a>(); <a name="l00194"></a>00194 <a class="code" href="classFtdi_1_1List.html#a42dc7256a0cacb1534388b272d71a6e1" title="Iterator type for the container.">iterator</a> <a class="code" href="classFtdi_1_1List.html#aabc5f6a4b69536ca68b7f364ba58d336">end</a>(); <a name="l00195"></a>00195 <a class="code" href="classFtdi_1_1List.html#a89f81377906bec5c14d262a959ac4bb0" title="Const iterator type for the container.">const_iterator</a> <a class="code" href="classFtdi_1_1List.html#a420ec5202f3c6a12de1b76c4842df42e">begin</a>() <span class="keyword">const</span>; <a name="l00196"></a>00196 <a class="code" href="classFtdi_1_1List.html#a89f81377906bec5c14d262a959ac4bb0" title="Const iterator type for the container.">const_iterator</a> <a class="code" href="classFtdi_1_1List.html#aabc5f6a4b69536ca68b7f364ba58d336">end</a>() <span class="keyword">const</span>; <a name="l00197"></a>00197 <a name="l00198"></a>00198 <a class="code" href="classFtdi_1_1List.html#a5031c32928ad47f6a8c9b425a557c998" title="Reverse iterator type for the container.">reverse_iterator</a> <a class="code" href="classFtdi_1_1List.html#a691d51ae1d7e04cc7100241fda7226b9">rbegin</a>(); <a name="l00199"></a>00199 <a class="code" href="classFtdi_1_1List.html#a5031c32928ad47f6a8c9b425a557c998" title="Reverse iterator type for the container.">reverse_iterator</a> <a class="code" href="classFtdi_1_1List.html#aaeae5fdd0a1595cfbca8c558b89d90df">rend</a>(); <a name="l00200"></a>00200 <a class="code" href="classFtdi_1_1List.html#a40ba96ede36bc45a2b22e0a9ceba9cc0" title="Const reverse iterator type for the container.">const_reverse_iterator</a> <a class="code" href="classFtdi_1_1List.html#a691d51ae1d7e04cc7100241fda7226b9">rbegin</a>() <span class="keyword">const</span>; <a name="l00201"></a>00201 <a class="code" href="classFtdi_1_1List.html#a40ba96ede36bc45a2b22e0a9ceba9cc0" title="Const reverse iterator type for the container.">const_reverse_iterator</a> <a class="code" href="classFtdi_1_1List.html#aaeae5fdd0a1595cfbca8c558b89d90df">rend</a>() <span class="keyword">const</span>; <a name="l00202"></a>00202 <a name="l00203"></a>00203 ListType::size_type <a class="code" href="classFtdi_1_1List.html#a2d76af7ee18d62d11f8048df95f05a69">size</a>() <span class="keyword">const</span>; <a name="l00204"></a>00204 <span class="keywordtype">bool</span> <a class="code" href="classFtdi_1_1List.html#a1d7362506f1d331d5ffafb8d68868d07">empty</a>() <span class="keyword">const</span>; <a name="l00205"></a>00205 <span class="keywordtype">void</span> <a class="code" href="classFtdi_1_1List.html#a3e518597e7e1d8cce072fbf0c75a9d32">clear</a>(); <a name="l00206"></a>00206 <a name="l00207"></a>00207 <span class="keywordtype">void</span> <a class="code" href="classFtdi_1_1List.html#a280cb7466bcdc7afbcf27893f6bba4df">push_back</a>(<span class="keyword">const</span> <a class="code" href="classFtdi_1_1Context.html" title="FTDI device context. Represents single FTDI device context.">Context</a>& element); <a name="l00208"></a>00208 <span class="keywordtype">void</span> <a class="code" href="classFtdi_1_1List.html#ae5bbd5d4b9c5c8c159a50a4f25a4c896">push_front</a>(<span class="keyword">const</span> <a class="code" href="classFtdi_1_1Context.html" title="FTDI device context. Represents single FTDI device context.">Context</a>& element); <a name="l00209"></a>00209 <a name="l00210"></a>00210 <a class="code" href="classFtdi_1_1List.html#a42dc7256a0cacb1534388b272d71a6e1" title="Iterator type for the container.">iterator</a> <a class="code" href="classFtdi_1_1List.html#a608e4633a7bac3a39ac51fd67f190a89">erase</a>(<a class="code" href="classFtdi_1_1List.html#a42dc7256a0cacb1534388b272d71a6e1" title="Iterator type for the container.">iterator</a> pos); <a name="l00211"></a>00211 <a class="code" href="classFtdi_1_1List.html#a42dc7256a0cacb1534388b272d71a6e1" title="Iterator type for the container.">iterator</a> <a class="code" href="classFtdi_1_1List.html#a608e4633a7bac3a39ac51fd67f190a89">erase</a>(<a class="code" href="classFtdi_1_1List.html#a42dc7256a0cacb1534388b272d71a6e1" title="Iterator type for the container.">iterator</a> beg, <a class="code" href="classFtdi_1_1List.html#a42dc7256a0cacb1534388b272d71a6e1" title="Iterator type for the container.">iterator</a> <a class="code" href="classFtdi_1_1List.html#aabc5f6a4b69536ca68b7f364ba58d336">end</a>); <a name="l00212"></a>00212 <a name="l00213"></a>00213 <span class="keyword">private</span>: <a name="l00214"></a>00214 <span class="keyword">class </span><a class="code" href="classFtdi_1_1List_1_1Private.html">Private</a>; <a name="l00215"></a>00215 boost::shared_ptr<Private> d; <a name="l00216"></a>00216 }; <a name="l00217"></a>00217 <a name="l00218"></a>00218 } <a name="l00219"></a>00219 <a name="l00220"></a>00220 <span class="preprocessor">#endif</span> </pre></div></div> </div> <hr size="1"><address style="text-align: right;"><small> Generated for libftdi by <a href="http://www.doxygen.org/ index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.1</small></address> </body> </html>