<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.3">
  <compounddef id="ftdi_8c" kind="file">
    <compoundname>ftdi.c</compoundname>
    <includes local="no">libusb.h</includes>
    <includes local="no">string.h</includes>
    <includes local="no">errno.h</includes>
    <includes local="no">stdio.h</includes>
    <includes local="no">stdlib.h</includes>
    <includes refid="ftdi__i_8h" local="yes">ftdi_i.h</includes>
    <includes refid="ftdi_8h" local="yes">ftdi.h</includes>
    <includes local="yes">ftdi_version_i.h</includes>
    <incdepgraph>
      <node id="8">
        <label>stdint.h</label>
      </node>
      <node id="5">
        <label>stdlib.h</label>
      </node>
      <node id="3">
        <label>errno.h</label>
      </node>
      <node id="2">
        <label>string.h</label>
      </node>
      <node id="1">
        <label>libusb.h</label>
      </node>
      <node id="0">
        <label>ftdi.c</label>
        <link refid="ftdi.c"/>
        <childnode refid="1" relation="include">
        </childnode>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="4" relation="include">
        </childnode>
        <childnode refid="5" relation="include">
        </childnode>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="7" relation="include">
        </childnode>
        <childnode refid="10" relation="include">
        </childnode>
      </node>
      <node id="7">
        <label>ftdi.h</label>
        <link refid="ftdi_8h"/>
        <childnode refid="8" relation="include">
        </childnode>
        <childnode refid="9" relation="include">
        </childnode>
      </node>
      <node id="10">
        <label>ftdi_version_i.h</label>
      </node>
      <node id="6">
        <label>ftdi_i.h</label>
        <link refid="ftdi__i_8h"/>
      </node>
      <node id="9">
        <label>sys/time.h</label>
      </node>
      <node id="4">
        <label>stdio.h</label>
      </node>
    </incdepgraph>
      <sectiondef kind="define">
      <memberdef kind="define" id="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" prot="public" static="no">
        <name>ftdi_error_return</name>
        <param><defname>code</defname></param>
        <param><defname>str</defname></param>
        <initializer>do {  \
        if ( ftdi )                        \
            ftdi-&gt;error_str = str;         \
        else                               \
            fprintf(stderr, str);          \
        return code;                       \
   } while(0);</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="47" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="41" bodyend="-1"/>
        <referencedby refid="group__libftdi_1ga42b4776b91c6b14d2d1008b160b78efa" compoundref="ftdi_8c" startline="1957" endline="1967">ftdi_disable_bitbang</referencedby>
        <referencedby refid="group__libftdi_1gaccf7f39923b4a9bbc626cca9f7ac40b1" compoundref="ftdi_8c" startline="2467" endline="2987">ftdi_eeprom_build</referencedby>
        <referencedby refid="group__libftdi_1gac91c95ae42ec1ba885dc54f39709c072" compoundref="ftdi_8c" startline="3020" endline="3398">ftdi_eeprom_decode</referencedby>
        <referencedby refid="group__libftdi_1ga0b04717765deb6706482a3f3124c0b4a" compoundref="ftdi_8c" startline="2292" endline="2397">ftdi_eeprom_initdefaults</referencedby>
        <referencedby refid="group__libftdi_1ga25eb9a83a925065b6c3b61b8f0565951" compoundref="ftdi_8c" startline="4055" endline="4108">ftdi_erase_eeprom</referencedby>
        <referencedby refid="group__libftdi_1ga92a449af4a1becc70e80e49f3c937bbd" compoundref="ftdi_8c" startline="3781" endline="3796">ftdi_get_eeprom_buf</referencedby>
        <referencedby refid="group__libftdi_1ga6213209895e40153d103a72654d53b81" compoundref="ftdi_8c" startline="3410" endline="3583">ftdi_get_eeprom_value</referencedby>
        <referencedby refid="group__libftdi_1gacf7b6dcc4de33db2263ce8a421e18bfc" compoundref="ftdi_8c" startline="2033" endline="2045">ftdi_get_latency_timer</referencedby>
        <referencedby refid="group__libftdi_1ga21e2ed53cad4fa8242022afe1e12d2ee" compoundref="ftdi_8c" startline="88" endline="121">ftdi_init</referencedby>
        <referencedby refid="group__libftdi_1ga396c3bf1435fb3317755868e28c47414" compoundref="ftdi_8c" startline="2087" endline="2100">ftdi_poll_modem_status</referencedby>
        <referencedby refid="group__libftdi_1gab978a76c2cc0dbfbc1fd6350db848300" compoundref="ftdi_8c" startline="3911" endline="3933">ftdi_read_chipid</referencedby>
        <referencedby refid="group__libftdi_1ga72d87e30015c98bd0be22e7c8c873345" compoundref="ftdi_8c" startline="1748" endline="1859">ftdi_read_data</referencedby>
        <referencedby refid="group__libftdi_1gab42b05f26b6a6545ae3ae1b4edc28e5c" compoundref="ftdi_8c" startline="1910" endline="1917">ftdi_read_data_get_chunksize</referencedby>
        <referencedby refid="group__libftdi_1ga65783703baf0828d519ef597bb2855c1" compoundref="ftdi_8c" startline="1873" endline="1899">ftdi_read_data_set_chunksize</referencedby>
        <referencedby refid="group__libftdi_1gac157786fdf2e9c6b51dd9b4ddbb34d5f" compoundref="ftdi_8c" startline="3852" endline="3882">ftdi_read_eeprom</referencedby>
        <referencedby refid="group__libftdi_1ga650df1dc49ec78f0ee58b1c4f2644fd9" compoundref="ftdi_8c" startline="3832" endline="3841">ftdi_read_eeprom_location</referencedby>
        <referencedby refid="group__libftdi_1gab823dd90f2359612b1546ef0ceebdc0e" compoundref="ftdi_8c" startline="1980" endline="1989">ftdi_read_pins</referencedby>
        <referencedby refid="group__libftdi_1gae80f1dc38f5c80946a56ec34a329e7f5" compoundref="ftdi_8c" startline="1236" endline="1267">ftdi_set_baudrate</referencedby>
        <referencedby refid="group__libftdi_1ga83b41e900a1faf2ecc0546ce48ec7e70" compoundref="ftdi_8c" startline="1931" endline="1946">ftdi_set_bitmode</referencedby>
        <referencedby refid="group__libftdi_1gaad29bea74f6ae02ed757d2a39c060969" compoundref="ftdi_8c" startline="3807" endline="3819">ftdi_set_eeprom_buf</referencedby>
        <referencedby refid="group__libftdi_1ga8e120f60f65859c1976c2dba99e9d002" compoundref="ftdi_8c" startline="3597" endline="3769">ftdi_set_eeprom_value</referencedby>
        <referencedby refid="group__libftdi_1gaeb9510a61f6648eb1bd57f0f99a390e1" compoundref="ftdi_8c" startline="2262" endline="2278">ftdi_set_error_char</referencedby>
        <referencedby refid="group__libftdi_1ga71eeabe2ee5474d5c0ceddc2e08766cd" compoundref="ftdi_8c" startline="2233" endline="2249">ftdi_set_event_char</referencedby>
        <referencedby refid="group__libftdi_1ga6dc886d709eced377a33dc975fa6e771" compoundref="ftdi_8c" startline="157" endline="203">ftdi_set_interface</referencedby>
        <referencedby refid="group__libftdi_1ga3e0227b0c7aa859d2d2afb5ffa4c8466" compoundref="ftdi_8c" startline="2006" endline="2021">ftdi_set_latency_timer</referencedby>
        <referencedby refid="group__libftdi_1ga481d055a35dd9042c1c23e2214d2655c" compoundref="ftdi_8c" startline="1301" endline="1358">ftdi_set_line_property2</referencedby>
        <referencedby refid="group__libftdi_1ga47761f16762363288c55f5fff24620d5" compoundref="ftdi_8c" startline="2136" endline="2154">ftdi_setdtr</referencedby>
        <referencedby refid="group__libftdi_1ga5a8f23c2e77c8b58c1f44a11e2f52aa9" compoundref="ftdi_8c" startline="2197" endline="2220">ftdi_setdtr_rts</referencedby>
        <referencedby refid="group__libftdi_1gac3b3d2cc69edf567e653340f434c91e0" compoundref="ftdi_8c" startline="2113" endline="2124">ftdi_setflowctrl</referencedby>
        <referencedby refid="group__libftdi_1ga5713ba73288b3e1ac1d45096c917c1ab" compoundref="ftdi_8c" startline="2166" endline="2184">ftdi_setrts</referencedby>
        <referencedby refid="group__libftdi_1ga9536eff48c7ae9313b2a97320743ee3b" compoundref="ftdi_8c" startline="984" endline="998">ftdi_usb_close</referencedby>
        <referencedby refid="group__libftdi_1ga2845a0c63809747c9c7b1ea404453bc4" compoundref="ftdi_8c" startline="310" endline="350">ftdi_usb_find_all</referencedby>
        <referencedby refid="group__libftdi_1ga17e8eae09e58bd3bfeeab8decfce7fd9" compoundref="ftdi_8c" startline="408" endline="452">ftdi_usb_get_strings</referencedby>
        <referencedby refid="group__libftdi_1ga3c5ccb0678b0e268b4081ea978e8eb78" compoundref="ftdi_8c" startline="689" endline="759">ftdi_usb_open_desc_index</referencedby>
        <referencedby refid="group__libftdi_1ga07d90df83e677ad08fe551de17fd7a41" compoundref="ftdi_8c" startline="522" endline="622">ftdi_usb_open_dev</referencedby>
        <referencedby refid="group__libftdi_1gaae805b82251a61dae46b98345cd84d5c" compoundref="ftdi_8c" startline="787" endline="869">ftdi_usb_open_string</referencedby>
        <referencedby refid="group__libftdi_1ga3089d7ceafad896c007111b8e5c02906" compoundref="ftdi_8c" startline="955" endline="971">ftdi_usb_purge_buffers</referencedby>
        <referencedby refid="group__libftdi_1ga25a6d4766e30bd47602ed0c0ecf53476" compoundref="ftdi_8c" startline="906" endline="921">ftdi_usb_purge_rx_buffer</referencedby>
        <referencedby refid="group__libftdi_1ga1eab1dfd17068c46775a86496fee8bec" compoundref="ftdi_8c" startline="932" endline="943">ftdi_usb_purge_tx_buffer</referencedby>
        <referencedby refid="group__libftdi_1ga266ccc351ea31289022063a8ae29edf4" compoundref="ftdi_8c" startline="880" endline="895">ftdi_usb_reset</referencedby>
        <referencedby refid="group__libftdi_1gaa79550f209ce3327a5df03f2bd1e80f0" compoundref="ftdi_8c" startline="1371" endline="1393">ftdi_write_data</referencedby>
        <referencedby refid="group__libftdi_1ga5944f14ffd11faa113515ff29dc769ed" compoundref="ftdi_8c" startline="1724" endline="1731">ftdi_write_data_get_chunksize</referencedby>
        <referencedby refid="group__libftdi_1ga85e22717c3315a09219b03a1862c0c46" compoundref="ftdi_8c" startline="1706" endline="1713">ftdi_write_data_set_chunksize</referencedby>
        <referencedby refid="group__libftdi_1ga8cc9811660d1adfb4b30157c5ab26d5a" compoundref="ftdi_8c" startline="4005" endline="4038">ftdi_write_eeprom</referencedby>
        <referencedby refid="group__libftdi_1ga5f2f678fc05cb8f92708fb1e5eb75100" compoundref="ftdi_8c" startline="3949" endline="3993">ftdi_write_eeprom_location</referencedby>
      </memberdef>
      <memberdef kind="define" id="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" prot="public" static="no">
        <name>ftdi_error_return_free_device_list</name>
        <param><defname>code</defname></param>
        <param><defname>str</defname></param>
        <param><defname>devs</defname></param>
        <initializer>do {    \
        libusb_free_device_list(devs,1);   \
        ftdi-&gt;error_str = str;             \
        return code;                       \
   } while(0);</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="53" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="49" bodyend="-1"/>
        <referencedby refid="group__libftdi_1ga2845a0c63809747c9c7b1ea404453bc4" compoundref="ftdi_8c" startline="310" endline="350">ftdi_usb_find_all</referencedby>
        <referencedby refid="group__libftdi_1ga3c5ccb0678b0e268b4081ea978e8eb78" compoundref="ftdi_8c" startline="689" endline="759">ftdi_usb_open_desc_index</referencedby>
        <referencedby refid="group__libftdi_1gaae805b82251a61dae46b98345cd84d5c" compoundref="ftdi_8c" startline="787" endline="869">ftdi_usb_open_string</referencedby>
      </memberdef>
      <memberdef kind="define" id="ftdi_8c_1a8e6e2daccfbf4c315f3f55f4ebf1f302" prot="public" static="no">
        <name>H_CLK</name>
        <initializer>120000000</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1174"/>
      </memberdef>
      <memberdef kind="define" id="ftdi_8c_1ab1611d2019aad8c7a5a523d3d9d13cfc" prot="public" static="no">
        <name>C_CLK</name>
        <initializer>48000000</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1175"/>
      </memberdef>
      <memberdef kind="define" id="group__libftdi_1ga94630370ae389fb1189282fa0742f310" prot="public" static="no">
        <name>MAGIC</name>
        <initializer>0x55aa</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Erase eeprom</para><para>This is not supported on FT232R/FT245R according to the MProg manual from FTDI.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>erase failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Writing magic failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-4</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Read EEPROM failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-5</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Unexpected EEPROM value </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="4054" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="4054" bodyend="-1"/>
        <referencedby refid="group__libftdi_1ga25eb9a83a925065b6c3b61b8f0565951" compoundref="ftdi_8c" startline="4055" endline="4108">ftdi_erase_eeprom</referencedby>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="group__libftdi_1ga9f3011d2f051e2979a942639ec36a829" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void ftdi_usb_close_internal</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_usb_close_internal</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Internal function to close usb device pointer. Sets ftdi-&gt;usb_dev to NULL. </para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="66" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="65" bodyend="74"/>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga21e2ed53cad4fa8242022afe1e12d2ee" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_init</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_init</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Initializes a <ref refid="structftdi__context" kindref="compound">ftdi_context</ref>.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>couldn&apos;t allocate read buffer </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>couldn&apos;t allocate struct buffer </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb_init() failed</para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="remark"><para>This should be called before all functions </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="89" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="88" bodyend="121"/>
        <references refid="ftdi_8h_1adb5c9021fa85791df4a0b9dac671109aa3fde2d289c2051df02332045e58f4a76" compoundref="ftdi_8h" startline="62">AUTO_DETACH_SIO_MODULE</references>
        <references refid="structftdi__context_1aa688eb2312af3a9fb6b56a8c59178e34" compoundref="ftdi_8h" startline="213">ftdi_context::baudrate</references>
        <references refid="structftdi__context_1a164c17ee7bddaa0d76da8da7138f602f" compoundref="ftdi_8h" startline="215">ftdi_context::bitbang_enabled</references>
        <references refid="structftdi__context_1a017557435f4377c2353d9d3b7fbcff01" compoundref="ftdi_8h" startline="240">ftdi_context::bitbang_mode</references>
        <references refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" compoundref="ftdi_8h" startline="243">ftdi_context::eeprom</references>
        <references refid="structftdi__context_1accc4dc90cea120d545faf82c6034d445" compoundref="ftdi_8h" startline="246">ftdi_context::error_str</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="group__libftdi_1ga65783703baf0828d519ef597bb2855c1" compoundref="ftdi_8c" startline="1873" endline="1899">ftdi_read_data_set_chunksize</references>
        <references refid="group__libftdi_1ga6dc886d709eced377a33dc975fa6e771" compoundref="ftdi_8c" startline="157" endline="203">ftdi_set_interface</references>
        <references refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a794b6a029883152ff98ea1f6c896b02d" compoundref="ftdi_8h" startline="52">INTERFACE_ANY</references>
        <references refid="structftdi__context_1a7ca2f7e68cd28e1c3079d029fd6129c0" compoundref="ftdi_8h" startline="227">ftdi_context::max_packet_size</references>
        <references refid="structftdi__context_1a06072f2484298ae90fcffe450a133250" compoundref="ftdi_8h" startline="249">ftdi_context::module_detach_mode</references>
        <references refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" compoundref="ftdi_8h" startline="217">ftdi_context::readbuffer</references>
        <references refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" compoundref="ftdi_8h" startline="219">ftdi_context::readbuffer_offset</references>
        <references refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" compoundref="ftdi_8h" startline="221">ftdi_context::readbuffer_remaining</references>
        <references refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" compoundref="ftdi_8h" startline="211">ftdi_context::type</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" compoundref="ftdi_8h" startline="24">TYPE_BM</references>
        <references refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" compoundref="ftdi_8h" startline="201">ftdi_context::usb_ctx</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" compoundref="ftdi_8h" startline="205">ftdi_context::usb_read_timeout</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <references refid="structftdi__context_1a127d66a8b7602bd767fb01ce90e2a6be" compoundref="ftdi_8h" startline="225">ftdi_context::writebuffer_chunksize</references>
        <referencedby refid="group__libftdi_1gafd46c6784367fd95c5f852d3b38949a8" compoundref="ftdi_8c" startline="128" endline="144">ftdi_new</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gafd46c6784367fd95c5f852d3b38949a8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
        <definition>struct ftdi_context* ftdi_new</definition>
        <argsstring>(void)</argsstring>
        <name>ftdi_new</name>
        <param>
          <type>void</type>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Allocate and initialize a new <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para><para><simplesect kind="return"><para>a pointer to a new <ref refid="structftdi__context" kindref="compound">ftdi_context</ref>, or NULL on failure </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="129" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="128" bodyend="144"/>
        <references refid="group__libftdi_1ga21e2ed53cad4fa8242022afe1e12d2ee" compoundref="ftdi_8c" startline="88" endline="121">ftdi_init</references>
        <referencedby refid="classFtdi_1_1Context_1_1Private_1a04d13cee8be6a93d1990d4519426e05d" compoundref="ftdi_8cpp" startline="40" endline="44">Ftdi::Context::Private::Private</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga6dc886d709eced377a33dc975fa6e771" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_set_interface</definition>
        <argsstring>(struct ftdi_context *ftdi, enum ftdi_interface interface)</argsstring>
        <name>ftdi_set_interface</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>enum <ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265" kindref="member">ftdi_interface</ref></type>
          <declname>interface</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Open selected channels on a chip, otherwise use first channel.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>interface</parametername>
</parameternamelist>
<parameterdescription>
<para>Interface to use for FT2232C/2232H/4232H chips.</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unknown interface </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Device already open, interface can&apos;t be set in that state </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="158" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="157" bodyend="203"/>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1a9b6cfd3763a3ca80c76bc52c89dad968" compoundref="ftdi_8h" startline="236">ftdi_context::in_ep</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" compoundref="ftdi_8h" startline="231">ftdi_context::interface</references>
        <references refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265afb60d9e73330c16ba970b3dd169fe4d1" compoundref="ftdi_8h" startline="53">INTERFACE_A</references>
        <references refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a794b6a029883152ff98ea1f6c896b02d" compoundref="ftdi_8h" startline="52">INTERFACE_ANY</references>
        <references refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a5326a506445adc927025ee5c55452380" compoundref="ftdi_8h" startline="54">INTERFACE_B</references>
        <references refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a1eb34784ca745a5d76480c190a92d68c" compoundref="ftdi_8h" startline="55">INTERFACE_C</references>
        <references refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a3b672d2aef77ffdf9d59d827db194021" compoundref="ftdi_8h" startline="56">INTERFACE_D</references>
        <references refid="structftdi__context_1a079427d8f2c09102bcadb9118e60c0ec" compoundref="ftdi_8h" startline="237">ftdi_context::out_ep</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <referencedby refid="group__libftdi_1ga21e2ed53cad4fa8242022afe1e12d2ee" compoundref="ftdi_8c" startline="88" endline="121">ftdi_init</referencedby>
        <referencedby refid="classFtdi_1_1Context_1a9baf46935760b09ba2f06cd978d83a41" compoundref="ftdi_8cpp" startline="157" endline="160">Ftdi::Context::set_interface</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga72838200be98d88737d532f9eee1e7be" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void ftdi_deinit</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_deinit</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Deinitializes a <ref refid="structftdi__context" kindref="compound">ftdi_context</ref>.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="211" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="210" bodyend="249"/>
        <references refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" compoundref="ftdi_8h" startline="243">ftdi_context::eeprom</references>
        <references refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" compoundref="ftdi__i_8h" startline="68">ftdi_eeprom::manufacturer</references>
        <references refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" compoundref="ftdi__i_8h" startline="70">ftdi_eeprom::product</references>
        <references refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" compoundref="ftdi_8h" startline="217">ftdi_context::readbuffer</references>
        <references refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" compoundref="ftdi__i_8h" startline="72">ftdi_eeprom::serial</references>
        <references refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" compoundref="ftdi_8h" startline="201">ftdi_context::usb_ctx</references>
        <referencedby refid="group__libftdi_1ga3cc28e5b7f1f50246861fcb39e7dd291" compoundref="ftdi_8c" startline="256" endline="260">ftdi_free</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga3cc28e5b7f1f50246861fcb39e7dd291" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void ftdi_free</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_free</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Deinitialize and free an <ref refid="structftdi__context" kindref="compound">ftdi_context</ref>.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="257" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="256" bodyend="260"/>
        <references refid="group__libftdi_1ga72838200be98d88737d532f9eee1e7be" compoundref="ftdi_8c" startline="210" endline="249">ftdi_deinit</references>
        <referencedby refid="classFtdi_1_1Context_1aaac96a16870d29bb7f59353a36524a39" compoundref="ftdi_8cpp" startline="362" endline="366">Ftdi::Context::set_context</referencedby>
        <referencedby refid="classFtdi_1_1Context_1_1Private_1ac6914d23ec3542ea32c8d2b2ec525e96" compoundref="ftdi_8cpp" startline="46" endline="52">Ftdi::Context::Private::~Private</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga1eb46e0bb208b64f88169b5452cf6e94" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void ftdi_set_usbdev</definition>
        <argsstring>(struct ftdi_context *ftdi, libusb_device_handle *usb)</argsstring>
        <name>ftdi_set_usbdev</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>libusb_device_handle *</type>
          <declname>usb</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Use an already open libusb device.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>usb</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb libusb_device_handle to use </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="269" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="268" bodyend="274"/>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <referencedby refid="classFtdi_1_1Context_1a3eb0536f23dbd7e2df286ee01ccc03ad" compoundref="ftdi_8cpp" startline="162" endline="166">Ftdi::Context::set_usb_device</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga161635898138bfc1ebecda10fc999cde" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>struct <ref refid="structftdi__version__info" kindref="compound">ftdi_version_info</ref></type>
        <definition>struct ftdi_version_info ftdi_get_library_version</definition>
        <argsstring>()</argsstring>
        <name>ftdi_get_library_version</name>
        <briefdescription>
<para>Get libftdi library version. </para>        </briefdescription>
        <detaileddescription>
<para><simplesect kind="return"><para><ref refid="structftdi__version__info" kindref="compound">ftdi_version_info</ref> Library version information </para></simplesect>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="282" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="281" bodyend="292"/>
        <references refid="structftdi__version__info_1a5644a73d7e253c663738d4e705999910" compoundref="ftdi_8h" startline="417">ftdi_version_info::major</references>
        <references refid="structftdi__version__info_1ab5dd11d114d02d509e2bf83eea4d180a" compoundref="ftdi_8h" startline="419">ftdi_version_info::micro</references>
        <references refid="structftdi__version__info_1a011b5e8cbe4af99afd0a0440e5e75669" compoundref="ftdi_8h" startline="418">ftdi_version_info::minor</references>
        <references refid="structftdi__version__info_1ae56ef54eaad3de9ced05282eb3cce62c" compoundref="ftdi_8h" startline="421">ftdi_version_info::snapshot_str</references>
        <references refid="structftdi__version__info_1af5581f9a5c2c2d03551bc1d8d0f026a1" compoundref="ftdi_8h" startline="420">ftdi_version_info::version_str</references>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga2845a0c63809747c9c7b1ea404453bc4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_usb_find_all</definition>
        <argsstring>(struct ftdi_context *ftdi, struct ftdi_device_list **devlist, int vendor, int product)</argsstring>
        <name>ftdi_usb_find_all</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>struct <ref refid="structftdi__device__list" kindref="compound">ftdi_device_list</ref> **</type>
          <declname>devlist</declname>
        </param>
        <param>
          <type>int</type>
          <declname>vendor</declname>
        </param>
        <param>
          <type>int</type>
          <declname>product</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Finds all ftdi devices with given VID:PID on the usb bus. Creates a new <ref refid="structftdi__device__list" kindref="compound">ftdi_device_list</ref> which needs to be deallocated by <ref refid="group__libftdi_1ga35358ea578644aa309300db782415c9f" kindref="member">ftdi_list_free()</ref> after use. With VID:PID 0:0, search for the default devices (0x403:0x6001, 0x403:0x6010, 0x403:0x6011, 0x403:0x6014)</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>devlist</parametername>
</parameternamelist>
<parameterdescription>
<para>Pointer where to store list of found devices </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>vendor</parametername>
</parameternamelist>
<parameterdescription>
<para>Vendor ID to search for </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>product</parametername>
</parameternamelist>
<parameterdescription>
<para>Product ID to search for</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>&gt;0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>number of devices found </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>out of memory </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-5</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb_get_device_list() failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-6</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb_get_device_descriptor() failed </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="311" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="310" bodyend="350"/>
        <references refid="structftdi__device__list_1aa8d986c61599a7f52a4d2fa1da434a37" compoundref="ftdi_8h" startline="322">ftdi_device_list::dev</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" compoundref="ftdi_8c" startline="49">ftdi_error_return_free_device_list</references>
        <references refid="structftdi__device__list_1aa80d0234b1a36e0e9a91605a7c74df37" compoundref="ftdi_8h" startline="320">ftdi_device_list::next</references>
        <references refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" compoundref="ftdi_8h" startline="201">ftdi_context::usb_ctx</references>
        <referencedby refid="classFtdi_1_1List_1ab7f76e262b065f3b1d36a51c20fa0feb" compoundref="ftdi_8cpp" startline="623" endline="628">Ftdi::List::find_all</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga35358ea578644aa309300db782415c9f" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void ftdi_list_free</definition>
        <argsstring>(struct ftdi_device_list **devlist)</argsstring>
        <name>ftdi_list_free</name>
        <param>
          <type>struct <ref refid="structftdi__device__list" kindref="compound">ftdi_device_list</ref> **</type>
          <declname>devlist</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Frees a usb device list.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>devlist</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device list created by <ref refid="group__libftdi_1ga2845a0c63809747c9c7b1ea404453bc4" kindref="member">ftdi_usb_find_all()</ref> </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="358" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="357" bodyend="370"/>
        <references refid="structftdi__device__list_1aa8d986c61599a7f52a4d2fa1da434a37" compoundref="ftdi_8h" startline="322">ftdi_device_list::dev</references>
        <references refid="structftdi__device__list_1aa80d0234b1a36e0e9a91605a7c74df37" compoundref="ftdi_8h" startline="320">ftdi_device_list::next</references>
        <referencedby refid="classFtdi_1_1List_1a3e518597e7e1d8cce072fbf0c75a9d32" compoundref="ftdi_8cpp" startline="572" endline="582">Ftdi::List::clear</referencedby>
        <referencedby refid="group__libftdi_1gaa4838bebb2024ae9bfdcc81adbda3493" compoundref="ftdi_8c" startline="377" endline="380">ftdi_list_free2</referencedby>
        <referencedby refid="classFtdi_1_1List_1_1Private_1aa5429f4a34d2eb4fc714d45c4fd7bee1" compoundref="ftdi_8cpp" startline="446" endline="450">Ftdi::List::Private::~Private</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gaa4838bebb2024ae9bfdcc81adbda3493" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void ftdi_list_free2</definition>
        <argsstring>(struct ftdi_device_list *devlist)</argsstring>
        <name>ftdi_list_free2</name>
        <param>
          <type>struct <ref refid="structftdi__device__list" kindref="compound">ftdi_device_list</ref> *</type>
          <declname>devlist</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Frees a usb device list.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>devlist</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device list created by <ref refid="group__libftdi_1ga2845a0c63809747c9c7b1ea404453bc4" kindref="member">ftdi_usb_find_all()</ref> </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="378" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="377" bodyend="380"/>
        <references refid="group__libftdi_1ga35358ea578644aa309300db782415c9f" compoundref="ftdi_8c" startline="357" endline="370">ftdi_list_free</references>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga17e8eae09e58bd3bfeeab8decfce7fd9" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_usb_get_strings</definition>
        <argsstring>(struct ftdi_context *ftdi, struct libusb_device *dev, char *manufacturer, int mnf_len, char *description, int desc_len, char *serial, int serial_len)</argsstring>
        <name>ftdi_usb_get_strings</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>struct libusb_device *</type>
          <declname>dev</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>manufacturer</declname>
        </param>
        <param>
          <type>int</type>
          <declname>mnf_len</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>description</declname>
        </param>
        <param>
          <type>int</type>
          <declname>desc_len</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>serial</declname>
        </param>
        <param>
          <type>int</type>
          <declname>serial_len</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Return device ID strings from the usb device.</para><para>The parameters manufacturer, description and serial may be NULL or pointer to buffers to store the fetched strings.</para><para><simplesect kind="note"><para>Use this function only in combination with <ref refid="group__libftdi_1ga2845a0c63809747c9c7b1ea404453bc4" kindref="member">ftdi_usb_find_all()</ref> as it closes the internal &quot;usb_dev&quot; after use.</para></simplesect>
<parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>dev</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb usb_dev to use </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>manufacturer</parametername>
</parameternamelist>
<parameterdescription>
<para>Store manufacturer string here if not NULL </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>mnf_len</parametername>
</parameternamelist>
<parameterdescription>
<para>Buffer size of manufacturer string </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>description</parametername>
</parameternamelist>
<parameterdescription>
<para>Store product description string here if not NULL </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>desc_len</parametername>
</parameternamelist>
<parameterdescription>
<para>Buffer size of product description string </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>serial</parametername>
</parameternamelist>
<parameterdescription>
<para>Store serial string here if not NULL </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>serial_len</parametername>
</parameternamelist>
<parameterdescription>
<para>Buffer size of serial string</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>wrong arguments </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-4</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to open device </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-7</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>get product manufacturer failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-8</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>get product description failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-9</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>get serial number failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-11</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb_get_device_descriptor() failed </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="410" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="408" bodyend="452"/>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <referencedby refid="classFtdi_1_1Context_1aaaf4d528fe4d70502b14582702103db8" compoundref="ftdi_8cpp" startline="302" endline="317">Ftdi::Context::get_strings</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga048332b2b47c4ece5bb88e96c21ad705" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>unsigned int</type>
        <definition>static unsigned int _ftdi_determine_max_packet_size</definition>
        <argsstring>(struct ftdi_context *ftdi, libusb_device *dev)</argsstring>
        <name>_ftdi_determine_max_packet_size</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>libusb_device *</type>
          <declname>dev</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Internal function to determine the maximum packet size. <parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>dev</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb usb_dev to use </para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>Maximum</parametername>
</parameternamelist>
<parameterdescription>
<para>packet size for this device </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="461" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="460" bodyend="502"/>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga07d90df83e677ad08fe551de17fd7a41" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_usb_open_dev</definition>
        <argsstring>(struct ftdi_context *ftdi, libusb_device *dev)</argsstring>
        <name>ftdi_usb_open_dev</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>libusb_device *</type>
          <declname>dev</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Opens a ftdi device given by an usb_device.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>dev</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb usb_dev to use</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to config device </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-4</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to open device </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-5</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to claim device </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-6</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>reset failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-7</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>set baudrate failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-8</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>ftdi context invalid </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-9</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb_get_device_descriptor() failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-10</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb_get_config_descriptor() failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-11</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb_detach_kernel_driver() failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-12</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb_get_configuration() failed </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="523" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="522" bodyend="622"/>
        <references refid="ftdi_8h_1adb5c9021fa85791df4a0b9dac671109aa3fde2d289c2051df02332045e58f4a76" compoundref="ftdi_8h" startline="62">AUTO_DETACH_SIO_MODULE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="group__libftdi_1gae80f1dc38f5c80946a56ec34a329e7f5" compoundref="ftdi_8c" startline="1236" endline="1267">ftdi_set_baudrate</references>
        <references refid="group__libftdi_1ga266ccc351ea31289022063a8ae29edf4" compoundref="ftdi_8c" startline="880" endline="895">ftdi_usb_reset</references>
        <references refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" compoundref="ftdi_8h" startline="231">ftdi_context::interface</references>
        <references refid="structftdi__context_1a7ca2f7e68cd28e1c3079d029fd6129c0" compoundref="ftdi_8h" startline="227">ftdi_context::max_packet_size</references>
        <references refid="structftdi__context_1a06072f2484298ae90fcffe450a133250" compoundref="ftdi_8h" startline="249">ftdi_context::module_detach_mode</references>
        <references refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" compoundref="ftdi_8h" startline="211">ftdi_context::type</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" compoundref="ftdi_8h" startline="24">TYPE_2232C</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" compoundref="ftdi_8h" startline="24">TYPE_2232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" compoundref="ftdi_8h" startline="24">TYPE_232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" compoundref="ftdi_8h" startline="24">TYPE_4232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" compoundref="ftdi_8h" startline="24">TYPE_AM</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" compoundref="ftdi_8h" startline="24">TYPE_BM</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" compoundref="ftdi_8h" startline="24">TYPE_R</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <referencedby refid="group__libftdi_1ga3c5ccb0678b0e268b4081ea978e8eb78" compoundref="ftdi_8c" startline="689" endline="759">ftdi_usb_open_desc_index</referencedby>
        <referencedby refid="group__libftdi_1gaae805b82251a61dae46b98345cd84d5c" compoundref="ftdi_8c" startline="787" endline="869">ftdi_usb_open_string</referencedby>
        <referencedby refid="classFtdi_1_1Context_1a6fa719a467db132076e752dd45223dbe" compoundref="ftdi_8cpp" startline="319" endline="339">Ftdi::Context::get_strings_and_reopen</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga95d4689db18fc1fd70011f6504ab8c40" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_usb_open</definition>
        <argsstring>(struct ftdi_context *ftdi, int vendor, int product)</argsstring>
        <name>ftdi_usb_open</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>int</type>
          <declname>vendor</declname>
        </param>
        <param>
          <type>int</type>
          <declname>product</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Opens the first device with a given vendor and product ids.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>vendor</parametername>
</parameternamelist>
<parameterdescription>
<para>Vendor ID </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>product</parametername>
</parameternamelist>
<parameterdescription>
<para>Product ID</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>same</parametername>
</parameternamelist>
<parameterdescription>
<para>as <ref refid="group__libftdi_1ga93c2c5f546f5968ae497c099d319ff32" kindref="member">ftdi_usb_open_desc()</ref> </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="634" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="633" bodyend="636"/>
        <references refid="group__libftdi_1ga93c2c5f546f5968ae497c099d319ff32" compoundref="ftdi_8c" startline="659" endline="663">ftdi_usb_open_desc</references>
        <referencedby refid="classFtdi_1_1Context_1a2669ea3eac16289990cd46cd777e295a" compoundref="ftdi_8cpp" startline="82" endline="91">Ftdi::Context::open</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga93c2c5f546f5968ae497c099d319ff32" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_usb_open_desc</definition>
        <argsstring>(struct ftdi_context *ftdi, int vendor, int product, const char *description, const char *serial)</argsstring>
        <name>ftdi_usb_open_desc</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>int</type>
          <declname>vendor</declname>
        </param>
        <param>
          <type>int</type>
          <declname>product</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>description</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>serial</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Opens the first device with a given, vendor id, product id, description and serial.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>vendor</parametername>
</parameternamelist>
<parameterdescription>
<para>Vendor ID </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>product</parametername>
</parameternamelist>
<parameterdescription>
<para>Product ID </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>description</parametername>
</parameternamelist>
<parameterdescription>
<para>Description to search for. Use NULL if not needed. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>serial</parametername>
</parameternamelist>
<parameterdescription>
<para>Serial to search for. Use NULL if not needed.</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>usb device not found </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-4</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to open device </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-5</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to claim device </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-6</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>reset failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-7</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>set baudrate failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-8</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>get product description failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-9</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>get serial number failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-12</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb_get_device_list() failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-13</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb_get_device_descriptor() failed </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="661" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="659" bodyend="663"/>
        <references refid="group__libftdi_1ga3c5ccb0678b0e268b4081ea978e8eb78" compoundref="ftdi_8c" startline="689" endline="759">ftdi_usb_open_desc_index</references>
        <referencedby refid="group__libftdi_1ga95d4689db18fc1fd70011f6504ab8c40" compoundref="ftdi_8c" startline="633" endline="636">ftdi_usb_open</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga3c5ccb0678b0e268b4081ea978e8eb78" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_usb_open_desc_index</definition>
        <argsstring>(struct ftdi_context *ftdi, int vendor, int product, const char *description, const char *serial, unsigned int index)</argsstring>
        <name>ftdi_usb_open_desc_index</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>int</type>
          <declname>vendor</declname>
        </param>
        <param>
          <type>int</type>
          <declname>product</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>description</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>serial</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>index</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Opens the index-th device with a given, vendor id, product id, description and serial.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>vendor</parametername>
</parameternamelist>
<parameterdescription>
<para>Vendor ID </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>product</parametername>
</parameternamelist>
<parameterdescription>
<para>Product ID </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>description</parametername>
</parameternamelist>
<parameterdescription>
<para>Description to search for. Use NULL if not needed. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>serial</parametername>
</parameternamelist>
<parameterdescription>
<para>Serial to search for. Use NULL if not needed. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>index</parametername>
</parameternamelist>
<parameterdescription>
<para>Number of matching device to open if there are more than one, starts with 0.</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>usb_find_busses() failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>usb_find_devices() failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>usb device not found </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-4</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to open device </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-5</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to claim device </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-6</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>reset failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-7</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>set baudrate failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-8</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>get product description failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-9</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>get serial number failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-10</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to close device </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-11</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>ftdi context invalid </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="691" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="689" bodyend="759"/>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" compoundref="ftdi_8c" startline="49">ftdi_error_return_free_device_list</references>
        <references refid="group__libftdi_1ga07d90df83e677ad08fe551de17fd7a41" compoundref="ftdi_8c" startline="522" endline="622">ftdi_usb_open_dev</references>
        <references refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" compoundref="ftdi_8h" startline="201">ftdi_context::usb_ctx</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <referencedby refid="group__libftdi_1ga93c2c5f546f5968ae497c099d319ff32" compoundref="ftdi_8c" startline="659" endline="663">ftdi_usb_open_desc</referencedby>
        <referencedby refid="group__libftdi_1gaae805b82251a61dae46b98345cd84d5c" compoundref="ftdi_8c" startline="787" endline="869">ftdi_usb_open_string</referencedby>
        <referencedby refid="classFtdi_1_1Context_1af6c6f42c9f6c10ff960e5163f0a052c6" compoundref="ftdi_8cpp" startline="93" endline="110">Ftdi::Context::open</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gaae805b82251a61dae46b98345cd84d5c" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_usb_open_string</definition>
        <argsstring>(struct ftdi_context *ftdi, const char *description)</argsstring>
        <name>ftdi_usb_open_string</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>const char *</type>
          <declname>description</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Opens the ftdi-device described by a description-string. Intended to be used for parsing a device-description given as commandline argument.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>description</parametername>
</parameternamelist>
<parameterdescription>
<para>NULL-terminated description-string, using this format: <itemizedlist>
<listitem><para><computeroutput>d:&lt;devicenode&gt;</computeroutput> path of bus and device-node (e.g. &quot;003/001&quot;) within usb device tree (usually at /proc/bus/usb/) </para></listitem>
<listitem><para><computeroutput>i:&lt;vendor&gt;:&lt;product&gt;</computeroutput> first device with given vendor and product id, ids can be decimal, octal (preceded by &quot;0&quot;) or hex (preceded by &quot;0x&quot;) </para></listitem>
<listitem><para><computeroutput>i:&lt;vendor&gt;:&lt;product&gt;:&lt;index&gt;</computeroutput> as above with index being the number of the device (starting with 0) if there are more than one </para></listitem>
<listitem><para><computeroutput>s:&lt;vendor&gt;:&lt;product&gt;:&lt;serial&gt;</computeroutput> first device with given vendor id, product id and serial string</para></listitem>
</itemizedlist>
</para></parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="note"><para>The description format may be extended in later versions.</para></simplesect>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>libusb_get_device_list() failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>usb device not found </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-4</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to open device </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-5</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to claim device </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-6</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>reset failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-7</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>set baudrate failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-8</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>get product description failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-9</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>get serial number failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-10</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to close device </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-11</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>illegal description format </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-12</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>ftdi context invalid </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="788" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="787" bodyend="869"/>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" compoundref="ftdi_8c" startline="49">ftdi_error_return_free_device_list</references>
        <references refid="group__libftdi_1ga3c5ccb0678b0e268b4081ea978e8eb78" compoundref="ftdi_8c" startline="689" endline="759">ftdi_usb_open_desc_index</references>
        <references refid="group__libftdi_1ga07d90df83e677ad08fe551de17fd7a41" compoundref="ftdi_8c" startline="522" endline="622">ftdi_usb_open_dev</references>
        <references refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" compoundref="ftdi_8h" startline="201">ftdi_context::usb_ctx</references>
        <referencedby refid="classFtdi_1_1Context_1a6dc5ad42a05d03cbf5b43365b79a3b62" compoundref="ftdi_8cpp" startline="112" endline="120">Ftdi::Context::open</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga266ccc351ea31289022063a8ae29edf4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_usb_reset</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_usb_reset</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Resets the ftdi device.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>FTDI reset failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="881" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="880" bodyend="895"/>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" compoundref="ftdi_8h" startline="219">ftdi_context::readbuffer_offset</references>
        <references refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" compoundref="ftdi_8h" startline="221">ftdi_context::readbuffer_remaining</references>
        <references refid="ftdi_8h_1a5950bd59bc692e59e8cc410667c21efb" compoundref="ftdi_8h" startline="134">SIO_RESET_REQUEST</references>
        <references refid="ftdi_8h_1ac0a9f9965ee40db86a2e2a0415558ede" compoundref="ftdi_8h" startline="151">SIO_RESET_SIO</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="group__libftdi_1ga07d90df83e677ad08fe551de17fd7a41" compoundref="ftdi_8c" startline="522" endline="622">ftdi_usb_open_dev</referencedby>
        <referencedby refid="group__libftdi_1ga8cc9811660d1adfb4b30157c5ab26d5a" compoundref="ftdi_8c" startline="4005" endline="4038">ftdi_write_eeprom</referencedby>
        <referencedby refid="classFtdi_1_1Context_1a3d318e752b00f0822d6e2c417420afde" compoundref="ftdi_8cpp" startline="140" endline="143">Ftdi::Context::reset</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga25a6d4766e30bd47602ed0c0ecf53476" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_usb_purge_rx_buffer</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_usb_purge_rx_buffer</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Clears the read buffer on the chip and the internal read buffer.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>read buffer purge failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="907" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="906" bodyend="921"/>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" compoundref="ftdi_8h" startline="219">ftdi_context::readbuffer_offset</references>
        <references refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" compoundref="ftdi_8h" startline="221">ftdi_context::readbuffer_remaining</references>
        <references refid="ftdi_8h_1ae61a2c543abcb5d1423e1a4580c785c5" compoundref="ftdi_8h" startline="152">SIO_RESET_PURGE_RX</references>
        <references refid="ftdi_8h_1a5950bd59bc692e59e8cc410667c21efb" compoundref="ftdi_8h" startline="134">SIO_RESET_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="classFtdi_1_1Context_1a36cf5e632dcc34f4ccd37a02eeedcb8d" compoundref="ftdi_8cpp" startline="145" endline="155">Ftdi::Context::flush</referencedby>
        <referencedby refid="group__libftdi_1ga3089d7ceafad896c007111b8e5c02906" compoundref="ftdi_8c" startline="955" endline="971">ftdi_usb_purge_buffers</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga1eab1dfd17068c46775a86496fee8bec" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_usb_purge_tx_buffer</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_usb_purge_tx_buffer</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Clears the write buffer on the chip.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>write buffer purge failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="933" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="932" bodyend="943"/>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1a318e8a6398bf99f58c1e7fdbaa31f3fb" compoundref="ftdi_8h" startline="153">SIO_RESET_PURGE_TX</references>
        <references refid="ftdi_8h_1a5950bd59bc692e59e8cc410667c21efb" compoundref="ftdi_8h" startline="134">SIO_RESET_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="classFtdi_1_1Context_1a36cf5e632dcc34f4ccd37a02eeedcb8d" compoundref="ftdi_8cpp" startline="145" endline="155">Ftdi::Context::flush</referencedby>
        <referencedby refid="group__libftdi_1ga3089d7ceafad896c007111b8e5c02906" compoundref="ftdi_8c" startline="955" endline="971">ftdi_usb_purge_buffers</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga3089d7ceafad896c007111b8e5c02906" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_usb_purge_buffers</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_usb_purge_buffers</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Clears the buffers on the chip and the internal read buffer.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>read buffer purge failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>write buffer purge failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="956" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="955" bodyend="971"/>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="group__libftdi_1ga25a6d4766e30bd47602ed0c0ecf53476" compoundref="ftdi_8c" startline="906" endline="921">ftdi_usb_purge_rx_buffer</references>
        <references refid="group__libftdi_1ga1eab1dfd17068c46775a86496fee8bec" compoundref="ftdi_8c" startline="932" endline="943">ftdi_usb_purge_tx_buffer</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <referencedby refid="ftdi__stream_8c_1abffdbbc8e303b2e4e85551734682a0b4" compoundref="ftdi__stream_8c" startline="147" endline="295">ftdi_readstream</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga9536eff48c7ae9313b2a97320743ee3b" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_usb_close</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_usb_close</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Closes the ftdi device. Call <ref refid="group__libftdi_1ga72838200be98d88737d532f9eee1e7be" kindref="member">ftdi_deinit()</ref> if you&apos;re cleaning up.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>usb_release failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>ftdi context invalid </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="985" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="984" bodyend="998"/>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" compoundref="ftdi_8h" startline="231">ftdi_context::interface</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <referencedby refid="classFtdi_1_1Context_1aad96d64cfe28b6085e384acdbcfe43fa" compoundref="ftdi_8cpp" startline="133" endline="138">Ftdi::Context::close</referencedby>
        <referencedby refid="classFtdi_1_1Context_1_1Private_1ac6914d23ec3542ea32c8d2b2ec525e96" compoundref="ftdi_8cpp" startline="46" endline="52">Ftdi::Context::Private::~Private</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga5f131fa8000a7a4f8112f137d294cdf6" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int ftdi_to_clkbits_AM</definition>
        <argsstring>(int baudrate, unsigned long *encoded_divisor)</argsstring>
        <name>ftdi_to_clkbits_AM</name>
        <param>
          <type>int</type>
          <declname>baudrate</declname>
        </param>
        <param>
          <type>unsigned long *</type>
          <declname>encoded_divisor</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1014" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1012" bodyend="1092"/>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga7d69638090fd12de8fbb8f2061f1430e" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int ftdi_to_clkbits</definition>
        <argsstring>(int baudrate, unsigned int clk, int clk_div, unsigned long *encoded_divisor)</argsstring>
        <name>ftdi_to_clkbits</name>
        <param>
          <type>int</type>
          <declname>baudrate</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>clk</declname>
        </param>
        <param>
          <type>int</type>
          <declname>clk_div</declname>
        </param>
        <param>
          <type>unsigned long *</type>
          <declname>encoded_divisor</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1119" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1118" bodyend="1156"/>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga584697533494b60422b6cce5b8c68b6e" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int ftdi_convert_baudrate</definition>
        <argsstring>(int baudrate, struct ftdi_context *ftdi, unsigned short *value, unsigned short *index)</argsstring>
        <name>ftdi_convert_baudrate</name>
        <param>
          <type>int</type>
          <declname>baudrate</declname>
        </param>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned short *</type>
          <declname>value</declname>
        </param>
        <param>
          <type>unsigned short *</type>
          <declname>index</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>ftdi_convert_baudrate returns nearest supported baud rate to that requested. Function is only used internally </para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1164" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1162" bodyend="1213"/>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga90fbdaa0bbee4c6d0d0ccd7225b2c843" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int convert_baudrate_UT_export</definition>
        <argsstring>(int baudrate, struct ftdi_context *ftdi, unsigned short *value, unsigned short *index)</argsstring>
        <name>convert_baudrate_UT_export</name>
        <param>
          <type>int</type>
          <declname>baudrate</declname>
        </param>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned short *</type>
          <declname>value</declname>
        </param>
        <param>
          <type>unsigned short *</type>
          <declname>index</declname>
        </param>
        <briefdescription>
<para>Wrapper function to export ftdi_convert_baudrate() to the unit test Do not use, it&apos;s only for the unit test framework. </para>        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1221" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1219" bodyend="1223"/>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gae80f1dc38f5c80946a56ec34a329e7f5" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_set_baudrate</definition>
        <argsstring>(struct ftdi_context *ftdi, int baudrate)</argsstring>
        <name>ftdi_set_baudrate</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>int</type>
          <declname>baudrate</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Sets the chip baud rate</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>baudrate</parametername>
</parameternamelist>
<parameterdescription>
<para>baud rate to set</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>invalid baudrate </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>setting baudrate failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1237" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1236" bodyend="1267"/>
        <references refid="structftdi__context_1aa688eb2312af3a9fb6b56a8c59178e34" compoundref="ftdi_8h" startline="213">ftdi_context::baudrate</references>
        <references refid="structftdi__context_1a164c17ee7bddaa0d76da8da7138f602f" compoundref="ftdi_8h" startline="215">ftdi_context::bitbang_enabled</references>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="ftdi_8h_1a92906a42c77f2165392071ae422fc068" compoundref="ftdi_8h" startline="135">SIO_SET_BAUDRATE_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="group__libftdi_1ga07d90df83e677ad08fe551de17fd7a41" compoundref="ftdi_8c" startline="522" endline="622">ftdi_usb_open_dev</referencedby>
        <referencedby refid="classFtdi_1_1Context_1a12d1736e590aefe7a4a3880d01961a20" compoundref="ftdi_8cpp" startline="168" endline="171">Ftdi::Context::set_baud_rate</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga044fdde91eaa3f557b545172622ee460" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_set_line_property</definition>
        <argsstring>(struct ftdi_context *ftdi, enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity)</argsstring>
        <name>ftdi_set_line_property</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>enum <ref refid="ftdi_8h_1a8007a7d5e37b76307c341051769e5c6f" kindref="member">ftdi_bits_type</ref></type>
          <declname>bits</declname>
        </param>
        <param>
          <type>enum <ref refid="ftdi_8h_1a3977a883c99069e02f97e99d059dc8b8" kindref="member">ftdi_stopbits_type</ref></type>
          <declname>sbit</declname>
        </param>
        <param>
          <type>enum <ref refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1d" kindref="member">ftdi_parity_type</ref></type>
          <declname>parity</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Set (RS232) line characteristics. The break type can only be set via <ref refid="group__libftdi_1ga481d055a35dd9042c1c23e2214d2655c" kindref="member">ftdi_set_line_property2()</ref> and defaults to &quot;off&quot;.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>bits</parametername>
</parameternamelist>
<parameterdescription>
<para>Number of bits </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>sbit</parametername>
</parameternamelist>
<parameterdescription>
<para>Number of stop bits </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>parity</parametername>
</parameternamelist>
<parameterdescription>
<para>Parity mode</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Setting line property failed </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1284" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1282" bodyend="1286"/>
        <references refid="ftdi_8h_1ae1ca6c6246df33380443c4ba6f192025a17b671576ab0f99edd941019303ce7a4" compoundref="ftdi_8h" startline="32">BREAK_OFF</references>
        <references refid="group__libftdi_1ga481d055a35dd9042c1c23e2214d2655c" compoundref="ftdi_8c" startline="1301" endline="1358">ftdi_set_line_property2</references>
        <referencedby refid="classFtdi_1_1Context_1acaf9f3ab2dde7b231e26cd35db4a962c" compoundref="ftdi_8cpp" startline="173" endline="176">Ftdi::Context::set_line_property</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga481d055a35dd9042c1c23e2214d2655c" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_set_line_property2</definition>
        <argsstring>(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)</argsstring>
        <name>ftdi_set_line_property2</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>enum <ref refid="ftdi_8h_1a8007a7d5e37b76307c341051769e5c6f" kindref="member">ftdi_bits_type</ref></type>
          <declname>bits</declname>
        </param>
        <param>
          <type>enum <ref refid="ftdi_8h_1a3977a883c99069e02f97e99d059dc8b8" kindref="member">ftdi_stopbits_type</ref></type>
          <declname>sbit</declname>
        </param>
        <param>
          <type>enum <ref refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1d" kindref="member">ftdi_parity_type</ref></type>
          <declname>parity</declname>
        </param>
        <param>
          <type>enum <ref refid="ftdi_8h_1ae1ca6c6246df33380443c4ba6f192025" kindref="member">ftdi_break_type</ref></type>
          <declname>break_type</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Set (RS232) line characteristics</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>bits</parametername>
</parameternamelist>
<parameterdescription>
<para>Number of bits </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>sbit</parametername>
</parameternamelist>
<parameterdescription>
<para>Number of stop bits </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>parity</parametername>
</parameternamelist>
<parameterdescription>
<para>Parity mode </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>break_type</parametername>
</parameternamelist>
<parameterdescription>
<para>Break type</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Setting line property failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1304" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1301" bodyend="1358"/>
        <references refid="ftdi_8h_1ae1ca6c6246df33380443c4ba6f192025a17b671576ab0f99edd941019303ce7a4" compoundref="ftdi_8h" startline="32">BREAK_OFF</references>
        <references refid="ftdi_8h_1ae1ca6c6246df33380443c4ba6f192025acf4ae3922d90ced9c3c6c4d48c3ef2e3" compoundref="ftdi_8h" startline="32">BREAK_ON</references>
        <references refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1da8487756fbc720579906f0ae1738f0fcc" compoundref="ftdi_8h" startline="26">EVEN</references>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1dab2a979177fd509f5398ec69341f7058f" compoundref="ftdi_8h" startline="26">MARK</references>
        <references refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1dac157bdf0b85a40d2619cbc8bc1ae5fe2" compoundref="ftdi_8h" startline="26">NONE</references>
        <references refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1daa29cedab858353a26006af9db7cd1ed8" compoundref="ftdi_8h" startline="26">ODD</references>
        <references refid="ftdi_8h_1a3060d361931e004cae4880164192c4ae" compoundref="ftdi_8h" startline="136">SIO_SET_DATA_REQUEST</references>
        <references refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1dac08dae7edcb5c5bb959fee5971fbad95" compoundref="ftdi_8h" startline="26">SPACE</references>
        <references refid="ftdi_8h_1a3977a883c99069e02f97e99d059dc8b8a706ed2f39ef4e69314ec3cda847d47f9" compoundref="ftdi_8h" startline="28">STOP_BIT_1</references>
        <references refid="ftdi_8h_1a3977a883c99069e02f97e99d059dc8b8abe0eab9d50a866c950d3cae314e772ba" compoundref="ftdi_8h" startline="28">STOP_BIT_15</references>
        <references refid="ftdi_8h_1a3977a883c99069e02f97e99d059dc8b8a9f707b03d4db34dd2d5f346f5ca590c6" compoundref="ftdi_8h" startline="28">STOP_BIT_2</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="group__libftdi_1ga044fdde91eaa3f557b545172622ee460" compoundref="ftdi_8c" startline="1282" endline="1286">ftdi_set_line_property</referencedby>
        <referencedby refid="classFtdi_1_1Context_1a2ba24f72d62c853538f0844259a98c4f" compoundref="ftdi_8cpp" startline="178" endline="181">Ftdi::Context::set_line_property</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gaa79550f209ce3327a5df03f2bd1e80f0" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_write_data</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned char *buf, int size)</argsstring>
        <name>ftdi_write_data</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned char *</type>
          <declname>buf</declname>
        </param>
        <param>
          <type>int</type>
          <declname>size</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Writes data in chunks (see <ref refid="group__libftdi_1ga85e22717c3315a09219b03a1862c0c46" kindref="member">ftdi_write_data_set_chunksize()</ref>) to the chip</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>buf</parametername>
</parameternamelist>
<parameterdescription>
<para>Buffer with the data </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>size</parametername>
</parameternamelist>
<parameterdescription>
<para>Size of the buffer</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>-666</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>&lt;0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>error code from usb_bulk_write() </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>&gt;0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>number of bytes written </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1372" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1371" bodyend="1393"/>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1a9b6cfd3763a3ca80c76bc52c89dad968" compoundref="ftdi_8h" startline="236">ftdi_context::in_ep</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <references refid="structftdi__context_1a127d66a8b7602bd767fb01ce90e2a6be" compoundref="ftdi_8h" startline="225">ftdi_context::writebuffer_chunksize</references>
        <referencedby refid="classFtdi_1_1Context_1a5cb1b4266a68f3bd9133e52178042ddf" compoundref="ftdi_8cpp" startline="202" endline="205">Ftdi::Context::write</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga755bd25613c9410f4a8112f9577735f0" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void ftdi_read_data_cb</definition>
        <argsstring>(struct libusb_transfer *transfer)</argsstring>
        <name>ftdi_read_data_cb</name>
        <param>
          <type>struct libusb_transfer *</type>
          <declname>transfer</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1396" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1395" bodyend="1474"/>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga5ba2e9f5af3a5b7f5c7e6261070080d4" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void ftdi_write_data_cb</definition>
        <argsstring>(struct libusb_transfer *transfer)</argsstring>
        <name>ftdi_write_data_cb</name>
        <param>
          <type>struct libusb_transfer *</type>
          <declname>transfer</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1478" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1477" bodyend="1502"/>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga90c2133a195fc7ebf229205c2755fc67" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>struct <ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref> *</type>
        <definition>struct ftdi_transfer_control* ftdi_write_data_submit</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned char *buf, int size)</argsstring>
        <name>ftdi_write_data_submit</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned char *</type>
          <declname>buf</declname>
        </param>
        <param>
          <type>int</type>
          <declname>size</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Writes data to the chip. Does not wait for completion of the transfer nor does it make sure that the transfer was successful.</para><para>Use libusb 1.0 asynchronous API.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>buf</parametername>
</parameternamelist>
<parameterdescription>
<para>Buffer with the data </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>size</parametername>
</parameternamelist>
<parameterdescription>
<para>Size of the buffer</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>NULL</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Some error happens when submit transfer </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>!NULL</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Pointer to a <ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref> </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1520" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1519" bodyend="1565"/>
        <references refid="structftdi__transfer__control_1a2667c871dacd0a472f778e4d08c5dfe5" compoundref="ftdi_8h" startline="185">ftdi_transfer_control::buf</references>
        <references refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" compoundref="ftdi_8h" startline="184">ftdi_transfer_control::completed</references>
        <references refid="structftdi__transfer__control_1a2df8400982dc8214f00852dec0f5f4a0" compoundref="ftdi_8h" startline="188">ftdi_transfer_control::ftdi</references>
        <references refid="structftdi__context_1a9b6cfd3763a3ca80c76bc52c89dad968" compoundref="ftdi_8h" startline="236">ftdi_context::in_ep</references>
        <references refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" compoundref="ftdi_8h" startline="187">ftdi_transfer_control::offset</references>
        <references refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" compoundref="ftdi_8h" startline="186">ftdi_transfer_control::size</references>
        <references refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" compoundref="ftdi_8h" startline="189">ftdi_transfer_control::transfer</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <references refid="structftdi__context_1a127d66a8b7602bd767fb01ce90e2a6be" compoundref="ftdi_8h" startline="225">ftdi_context::writebuffer_chunksize</references>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gab4dd69a3332c544dfdcbf4da85bd8801" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>struct <ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref> *</type>
        <definition>struct ftdi_transfer_control* ftdi_read_data_submit</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned char *buf, int size)</argsstring>
        <name>ftdi_read_data_submit</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned char *</type>
          <declname>buf</declname>
        </param>
        <param>
          <type>int</type>
          <declname>size</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Reads data from the chip. Does not wait for completion of the transfer nor does it make sure that the transfer was successful.</para><para>Use libusb 1.0 asynchronous API.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>buf</parametername>
</parameternamelist>
<parameterdescription>
<para>Buffer with the data </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>size</parametername>
</parameternamelist>
<parameterdescription>
<para>Size of the buffer</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>NULL</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Some error happens when submit transfer </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>!NULL</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Pointer to a <ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref> </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1582" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1581" bodyend="1647"/>
        <references refid="structftdi__transfer__control_1a2667c871dacd0a472f778e4d08c5dfe5" compoundref="ftdi_8h" startline="185">ftdi_transfer_control::buf</references>
        <references refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" compoundref="ftdi_8h" startline="184">ftdi_transfer_control::completed</references>
        <references refid="structftdi__transfer__control_1a2df8400982dc8214f00852dec0f5f4a0" compoundref="ftdi_8h" startline="188">ftdi_transfer_control::ftdi</references>
        <references refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" compoundref="ftdi_8h" startline="187">ftdi_transfer_control::offset</references>
        <references refid="structftdi__context_1a079427d8f2c09102bcadb9118e60c0ec" compoundref="ftdi_8h" startline="237">ftdi_context::out_ep</references>
        <references refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" compoundref="ftdi_8h" startline="217">ftdi_context::readbuffer</references>
        <references refid="structftdi__context_1a8bd3ab7267621b4a8ec3f08ae18b1c00" compoundref="ftdi_8h" startline="223">ftdi_context::readbuffer_chunksize</references>
        <references refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" compoundref="ftdi_8h" startline="219">ftdi_context::readbuffer_offset</references>
        <references refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" compoundref="ftdi_8h" startline="221">ftdi_context::readbuffer_remaining</references>
        <references refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" compoundref="ftdi_8h" startline="186">ftdi_transfer_control::size</references>
        <references refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" compoundref="ftdi_8h" startline="189">ftdi_transfer_control::transfer</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" compoundref="ftdi_8h" startline="205">ftdi_context::usb_read_timeout</references>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gaf580b6263d15746d1f5d3759f9c3ac02" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_transfer_data_done</definition>
        <argsstring>(struct ftdi_transfer_control *tc)</argsstring>
        <name>ftdi_transfer_data_done</name>
        <param>
          <type>struct <ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref> *</type>
          <declname>tc</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Wait for completion of the transfer.</para><para>Use libusb 1.0 asynchronous API.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>tc</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>&lt;</parametername>
</parameternamelist>
<parameterdescription>
<para>0: Some error happens </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>&gt;=</parametername>
</parameternamelist>
<parameterdescription>
<para>0: Data size transferred </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
<para>tc-&gt;transfer could be NULL if &quot;(size &lt;= ftdi-&gt;readbuffer_remaining)&quot; at <ref refid="group__libftdi_1gab4dd69a3332c544dfdcbf4da85bd8801" kindref="member">ftdi_read_data_submit()</ref>. Therefore, we need to check it here.</para>        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1661" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1660" bodyend="1694"/>
        <references refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" compoundref="ftdi_8h" startline="184">ftdi_transfer_control::completed</references>
        <references refid="structftdi__transfer__control_1a2df8400982dc8214f00852dec0f5f4a0" compoundref="ftdi_8h" startline="188">ftdi_transfer_control::ftdi</references>
        <references refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" compoundref="ftdi_8h" startline="187">ftdi_transfer_control::offset</references>
        <references refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" compoundref="ftdi_8h" startline="189">ftdi_transfer_control::transfer</references>
        <references refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" compoundref="ftdi_8h" startline="201">ftdi_context::usb_ctx</references>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga85e22717c3315a09219b03a1862c0c46" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_write_data_set_chunksize</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned int chunksize)</argsstring>
        <name>ftdi_write_data_set_chunksize</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>chunksize</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Configure write buffer chunk size. Default is 4096.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>chunksize</parametername>
</parameternamelist>
<parameterdescription>
<para>Chunk size</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>ftdi context invalid </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1707" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1706" bodyend="1713"/>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1a127d66a8b7602bd767fb01ce90e2a6be" compoundref="ftdi_8h" startline="225">ftdi_context::writebuffer_chunksize</references>
        <referencedby refid="classFtdi_1_1Context_1a54859d31d5177488aefa95067c8d4666" compoundref="ftdi_8cpp" startline="207" endline="210">Ftdi::Context::set_write_chunk_size</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga5944f14ffd11faa113515ff29dc769ed" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_write_data_get_chunksize</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned int *chunksize)</argsstring>
        <name>ftdi_write_data_get_chunksize</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned int *</type>
          <declname>chunksize</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Get write buffer chunk size.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>chunksize</parametername>
</parameternamelist>
<parameterdescription>
<para>Pointer to store chunk size in</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>ftdi context invalid </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1725" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1724" bodyend="1731"/>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1a127d66a8b7602bd767fb01ce90e2a6be" compoundref="ftdi_8h" startline="225">ftdi_context::writebuffer_chunksize</references>
        <referencedby refid="classFtdi_1_1Context_1ad4500d40d2bd07f383724968ffa945a2" compoundref="ftdi_8cpp" startline="212" endline="219">Ftdi::Context::write_chunk_size</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga72d87e30015c98bd0be22e7c8c873345" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_read_data</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned char *buf, int size)</argsstring>
        <name>ftdi_read_data</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned char *</type>
          <declname>buf</declname>
        </param>
        <param>
          <type>int</type>
          <declname>size</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Reads data in chunks (see <ref refid="group__libftdi_1ga65783703baf0828d519ef597bb2855c1" kindref="member">ftdi_read_data_set_chunksize()</ref>) from the chip.</para><para>Automatically strips the two modem status bytes transfered during every read.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>buf</parametername>
</parameternamelist>
<parameterdescription>
<para>Buffer to store data in </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>size</parametername>
</parameternamelist>
<parameterdescription>
<para>Size of the buffer</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>-666</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>&lt;0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>error code from libusb_bulk_transfer() </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>no data was available </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>&gt;0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>number of bytes read </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1749" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1748" bodyend="1859"/>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1a7ca2f7e68cd28e1c3079d029fd6129c0" compoundref="ftdi_8h" startline="227">ftdi_context::max_packet_size</references>
        <references refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" compoundref="ftdi_8h" startline="187">ftdi_transfer_control::offset</references>
        <references refid="structftdi__context_1a079427d8f2c09102bcadb9118e60c0ec" compoundref="ftdi_8h" startline="237">ftdi_context::out_ep</references>
        <references refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" compoundref="ftdi_8h" startline="217">ftdi_context::readbuffer</references>
        <references refid="structftdi__context_1a8bd3ab7267621b4a8ec3f08ae18b1c00" compoundref="ftdi_8h" startline="223">ftdi_context::readbuffer_chunksize</references>
        <references refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" compoundref="ftdi_8h" startline="219">ftdi_context::readbuffer_offset</references>
        <references refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" compoundref="ftdi_8h" startline="221">ftdi_context::readbuffer_remaining</references>
        <references refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" compoundref="ftdi_8h" startline="186">ftdi_transfer_control::size</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" compoundref="ftdi_8h" startline="205">ftdi_context::usb_read_timeout</references>
        <referencedby refid="classFtdi_1_1Context_1a1858062c4dacda2ab8271cd51550b7ee" compoundref="ftdi_8cpp" startline="183" endline="186">Ftdi::Context::read</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga65783703baf0828d519ef597bb2855c1" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_read_data_set_chunksize</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned int chunksize)</argsstring>
        <name>ftdi_read_data_set_chunksize</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned int</type>
          <declname>chunksize</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Configure read buffer chunk size. Default is 4096.</para><para>Automatically reallocates the buffer.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>chunksize</parametername>
</parameternamelist>
<parameterdescription>
<para>Chunk size</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>ftdi context invalid </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1874" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1873" bodyend="1899"/>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" compoundref="ftdi_8h" startline="217">ftdi_context::readbuffer</references>
        <references refid="structftdi__context_1a8bd3ab7267621b4a8ec3f08ae18b1c00" compoundref="ftdi_8h" startline="223">ftdi_context::readbuffer_chunksize</references>
        <references refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" compoundref="ftdi_8h" startline="219">ftdi_context::readbuffer_offset</references>
        <references refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" compoundref="ftdi_8h" startline="221">ftdi_context::readbuffer_remaining</references>
        <referencedby refid="group__libftdi_1ga21e2ed53cad4fa8242022afe1e12d2ee" compoundref="ftdi_8c" startline="88" endline="121">ftdi_init</referencedby>
        <referencedby refid="classFtdi_1_1Context_1a6e4b4df1cd2c0786b94620b4e5b2f80f" compoundref="ftdi_8cpp" startline="188" endline="191">Ftdi::Context::set_read_chunk_size</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gab42b05f26b6a6545ae3ae1b4edc28e5c" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_read_data_get_chunksize</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned int *chunksize)</argsstring>
        <name>ftdi_read_data_get_chunksize</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned int *</type>
          <declname>chunksize</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Get read buffer chunk size.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>chunksize</parametername>
</parameternamelist>
<parameterdescription>
<para>Pointer to store chunk size in</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>FTDI context invalid </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1911" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1910" bodyend="1917"/>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1a8bd3ab7267621b4a8ec3f08ae18b1c00" compoundref="ftdi_8h" startline="223">ftdi_context::readbuffer_chunksize</references>
        <referencedby refid="classFtdi_1_1Context_1a4c482b031ffe04b12087e573e91e4b79" compoundref="ftdi_8cpp" startline="193" endline="200">Ftdi::Context::read_chunk_size</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga83b41e900a1faf2ecc0546ce48ec7e70" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_set_bitmode</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned char bitmask, unsigned char mode)</argsstring>
        <name>ftdi_set_bitmode</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned char</type>
          <declname>bitmask</declname>
        </param>
        <param>
          <type>unsigned char</type>
          <declname>mode</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Enable/disable bitbang modes.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>bitmask</parametername>
</parameternamelist>
<parameterdescription>
<para>Bitmask to configure lines. HIGH/ON value configures a line as output. </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>mode</parametername>
</parameternamelist>
<parameterdescription>
<para>Bitbang mode: use the values defined in <ref refid="ftdi_8h_1a2250f7812c87a96ada7fd4f19b82f666" kindref="member">ftdi_mpsse_mode</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>can&apos;t enable bitbang mode </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1932" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1931" bodyend="1946"/>
        <references refid="structftdi__context_1a164c17ee7bddaa0d76da8da7138f602f" compoundref="ftdi_8h" startline="215">ftdi_context::bitbang_enabled</references>
        <references refid="structftdi__context_1a017557435f4377c2353d9d3b7fbcff01" compoundref="ftdi_8h" startline="240">ftdi_context::bitbang_mode</references>
        <references refid="ftdi_8h_1a2250f7812c87a96ada7fd4f19b82f666a9a39449cbe4c114e1e6bfa7d699470d0" compoundref="ftdi_8h" startline="37">BITMODE_RESET</references>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1afe6cb4f5f53d7e21f50479c8847d4d26" compoundref="ftdi_8h" startline="144">SIO_SET_BITMODE_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="ftdi__stream_8c_1abffdbbc8e303b2e4e85551734682a0b4" compoundref="ftdi__stream_8c" startline="147" endline="295">ftdi_readstream</referencedby>
        <referencedby refid="classFtdi_1_1Context_1ad8a0a54d23eb0f6b8b3c77155c1b4487" compoundref="ftdi_8cpp" startline="277" endline="280">Ftdi::Context::set_bitmode</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga42b4776b91c6b14d2d1008b160b78efa" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_disable_bitbang</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_disable_bitbang</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Disable bitbang mode.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>can&apos;t disable bitbang mode </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1958" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1957" bodyend="1967"/>
        <references refid="structftdi__context_1a164c17ee7bddaa0d76da8da7138f602f" compoundref="ftdi_8h" startline="215">ftdi_context::bitbang_enabled</references>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1afe6cb4f5f53d7e21f50479c8847d4d26" compoundref="ftdi_8h" startline="144">SIO_SET_BITMODE_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="classFtdi_1_1Context_1ace0a0738c511bf041a456b94ca096ec9" compoundref="ftdi_8cpp" startline="287" endline="290">Ftdi::Context::bitbang_disable</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gab823dd90f2359612b1546ef0ceebdc0e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_read_pins</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned char *pins)</argsstring>
        <name>ftdi_read_pins</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned char *</type>
          <declname>pins</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Directly read pin state, circumventing the read buffer. Useful for bitbang mode.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>pins</parametername>
</parameternamelist>
<parameterdescription>
<para>Pointer to store pins into</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>read pins failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="1981" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="1980" bodyend="1989"/>
        <references refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" compoundref="ftdi_8h" startline="131">FTDI_DEVICE_IN_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1a6891bba67d5536ca8108a3c5bed01866" compoundref="ftdi_8h" startline="145">SIO_READ_PINS_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" compoundref="ftdi_8h" startline="205">ftdi_context::usb_read_timeout</references>
        <referencedby refid="classFtdi_1_1Context_1aa41e612799358ce70b4a5003ebcfe9ec" compoundref="ftdi_8cpp" startline="292" endline="295">Ftdi::Context::read_pins</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga3e0227b0c7aa859d2d2afb5ffa4c8466" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_set_latency_timer</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned char latency)</argsstring>
        <name>ftdi_set_latency_timer</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned char</type>
          <declname>latency</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Set latency timer</para><para>The FTDI chip keeps data in the internal buffer for a specific amount of time if the buffer is not full yet to decrease load on the usb bus.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>latency</parametername>
</parameternamelist>
<parameterdescription>
<para>Value between 1 and 255</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>latency out of range </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to set latency timer </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2007" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2006" bodyend="2021"/>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1a6a69ccd99fa8f1d77ba9475a69a3256d" compoundref="ftdi_8h" startline="142">SIO_SET_LATENCY_TIMER_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="group__libftdi_1ga8cc9811660d1adfb4b30157c5ab26d5a" compoundref="ftdi_8c" startline="4005" endline="4038">ftdi_write_eeprom</referencedby>
        <referencedby refid="classFtdi_1_1Context_1a60ebdaac48d273b925ff35c510f3c19a" compoundref="ftdi_8cpp" startline="248" endline="251">Ftdi::Context::set_latency</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gacf7b6dcc4de33db2263ce8a421e18bfc" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_get_latency_timer</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned char *latency)</argsstring>
        <name>ftdi_get_latency_timer</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned char *</type>
          <declname>latency</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Get latency timer</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>latency</parametername>
</parameternamelist>
<parameterdescription>
<para>Pointer to store latency value in</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to get latency timer </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2034" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2033" bodyend="2045"/>
        <references refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" compoundref="ftdi_8h" startline="131">FTDI_DEVICE_IN_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1ad4c92540084ee84c0eead313a7bbe3fa" compoundref="ftdi_8h" startline="143">SIO_GET_LATENCY_TIMER_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" compoundref="ftdi_8h" startline="205">ftdi_context::usb_read_timeout</references>
        <referencedby refid="classFtdi_1_1Context_1a7e87873dc7c2987cd588f4f4d72e7732" compoundref="ftdi_8cpp" startline="253" endline="258">Ftdi::Context::latency</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga396c3bf1435fb3317755868e28c47414" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_poll_modem_status</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned short *status)</argsstring>
        <name>ftdi_poll_modem_status</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned short *</type>
          <declname>status</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Poll modem status information</para><para>This function allows the retrieve the two status bytes of the device. The device sends these bytes also as a header for each read access where they are discarded by <ref refid="group__libftdi_1ga72d87e30015c98bd0be22e7c8c873345" kindref="member">ftdi_read_data()</ref>. The chip generates the two stripped status bytes in the absence of data every 40 ms.</para><para>Layout of the first byte:<itemizedlist>
<listitem><para>B0..B3 - must be 0</para></listitem><listitem><para>B4 Clear to send (CTS) 0 = inactive 1 = active</para></listitem><listitem><para>B5 Data set ready (DTS) 0 = inactive 1 = active</para></listitem><listitem><para>B6 Ring indicator (RI) 0 = inactive 1 = active</para></listitem><listitem><para>B7 Receive line signal detect (RLSD) 0 = inactive 1 = active</para></listitem></itemizedlist>
</para><para>Layout of the second byte:<itemizedlist>
<listitem><para>B0 Data ready (DR)</para></listitem><listitem><para>B1 Overrun error (OE)</para></listitem><listitem><para>B2 Parity error (PE)</para></listitem><listitem><para>B3 Framing error (FE)</para></listitem><listitem><para>B4 Break interrupt (BI)</para></listitem><listitem><para>B5 Transmitter holding register (THRE)</para></listitem><listitem><para>B6 Transmitter empty (TEMT)</para></listitem><listitem><para>B7 Error in RCVR FIFO</para></listitem></itemizedlist>
</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>status</parametername>
</parameternamelist>
<parameterdescription>
<para>Pointer to store status information in. Must be two bytes.</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to retrieve status information </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2088" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2087" bodyend="2100"/>
        <references refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" compoundref="ftdi_8h" startline="131">FTDI_DEVICE_IN_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1aadec0bf6ad89f4fd94d7a5f5a212aa36" compoundref="ftdi_8h" startline="139">SIO_POLL_MODEM_STATUS_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" compoundref="ftdi_8h" startline="205">ftdi_context::usb_read_timeout</references>
        <referencedby refid="group__libftdi_1ga8cc9811660d1adfb4b30157c5ab26d5a" compoundref="ftdi_8c" startline="4005" endline="4038">ftdi_write_eeprom</referencedby>
        <referencedby refid="classFtdi_1_1Context_1a9204d8315dd586286535da2a68917dad" compoundref="ftdi_8cpp" startline="260" endline="265">Ftdi::Context::poll_modem_status</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gac3b3d2cc69edf567e653340f434c91e0" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_setflowctrl</definition>
        <argsstring>(struct ftdi_context *ftdi, int flowctrl)</argsstring>
        <name>ftdi_setflowctrl</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>int</type>
          <declname>flowctrl</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Set flowcontrol for ftdi chip</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>flowctrl</parametername>
</parameternamelist>
<parameterdescription>
<para>flow control to use. should be SIO_DISABLE_FLOW_CTRL, SIO_RTS_CTS_HS, SIO_DTR_DSR_HS or SIO_XON_XOFF_HS</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>set flow control failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2114" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2113" bodyend="2124"/>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1ac1f7891448c392bf8b59a99dd9f0cc8b" compoundref="ftdi_8h" startline="137">SIO_SET_FLOW_CTRL_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="classFtdi_1_1Context_1a0c29fde1904335a1213ce1e1982adc24" compoundref="ftdi_8cpp" startline="221" endline="224">Ftdi::Context::set_flow_control</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga47761f16762363288c55f5fff24620d5" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_setdtr</definition>
        <argsstring>(struct ftdi_context *ftdi, int state)</argsstring>
        <name>ftdi_setdtr</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>int</type>
          <declname>state</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Set dtr line</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>state</parametername>
</parameternamelist>
<parameterdescription>
<para>state to set line to (1 or 0)</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>set dtr failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2137" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2136" bodyend="2154"/>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1ab93aac18cc98c8601ee233089b1e1874" compoundref="ftdi_8h" startline="161">SIO_SET_DTR_HIGH</references>
        <references refid="ftdi_8h_1a0e7b24544b495e4701640d4ea181e29a" compoundref="ftdi_8h" startline="162">SIO_SET_DTR_LOW</references>
        <references refid="ftdi_8h_1a634bc73352c2a79fdea9ded7e19cd7db" compoundref="ftdi_8h" startline="138">SIO_SET_MODEM_CTRL_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="classFtdi_1_1Context_1a5f05bf405868e37d2efe50afaf377706" compoundref="ftdi_8cpp" startline="238" endline="241">Ftdi::Context::set_dtr</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga5713ba73288b3e1ac1d45096c917c1ab" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_setrts</definition>
        <argsstring>(struct ftdi_context *ftdi, int state)</argsstring>
        <name>ftdi_setrts</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>int</type>
          <declname>state</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Set rts line</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>state</parametername>
</parameternamelist>
<parameterdescription>
<para>state to set line to (1 or 0)</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>set rts failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2167" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2166" bodyend="2184"/>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1a634bc73352c2a79fdea9ded7e19cd7db" compoundref="ftdi_8h" startline="138">SIO_SET_MODEM_CTRL_REQUEST</references>
        <references refid="ftdi_8h_1af2a5be61d404ae9d5283420c8146048d" compoundref="ftdi_8h" startline="164">SIO_SET_RTS_HIGH</references>
        <references refid="ftdi_8h_1aca30d9bfc0334b28fcc0ab639c4a6cc5" compoundref="ftdi_8h" startline="165">SIO_SET_RTS_LOW</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="classFtdi_1_1Context_1ae5e60eb0188ba8039ee7b50329779cb0" compoundref="ftdi_8cpp" startline="243" endline="246">Ftdi::Context::set_rts</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga5a8f23c2e77c8b58c1f44a11e2f52aa9" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_setdtr_rts</definition>
        <argsstring>(struct ftdi_context *ftdi, int dtr, int rts)</argsstring>
        <name>ftdi_setdtr_rts</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>int</type>
          <declname>dtr</declname>
        </param>
        <param>
          <type>int</type>
          <declname>rts</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Set dtr and rts line in one pass</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>dtr</parametername>
</parameternamelist>
<parameterdescription>
<para>DTR state to set line to (1 or 0) </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>rts</parametername>
</parameternamelist>
<parameterdescription>
<para>RTS state to set line to (1 or 0)</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>set dtr/rts failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2198" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2197" bodyend="2220"/>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1ab93aac18cc98c8601ee233089b1e1874" compoundref="ftdi_8h" startline="161">SIO_SET_DTR_HIGH</references>
        <references refid="ftdi_8h_1a0e7b24544b495e4701640d4ea181e29a" compoundref="ftdi_8h" startline="162">SIO_SET_DTR_LOW</references>
        <references refid="ftdi_8h_1a634bc73352c2a79fdea9ded7e19cd7db" compoundref="ftdi_8h" startline="138">SIO_SET_MODEM_CTRL_REQUEST</references>
        <references refid="ftdi_8h_1af2a5be61d404ae9d5283420c8146048d" compoundref="ftdi_8h" startline="164">SIO_SET_RTS_HIGH</references>
        <references refid="ftdi_8h_1aca30d9bfc0334b28fcc0ab639c4a6cc5" compoundref="ftdi_8h" startline="165">SIO_SET_RTS_LOW</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="classFtdi_1_1Context_1ad1968faa8b41f6c49c70a55872a6bdbc" compoundref="ftdi_8cpp" startline="226" endline="236">Ftdi::Context::set_modem_control</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga71eeabe2ee5474d5c0ceddc2e08766cd" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_set_event_char</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned char eventch, unsigned char enable)</argsstring>
        <name>ftdi_set_event_char</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned char</type>
          <declname>eventch</declname>
        </param>
        <param>
          <type>unsigned char</type>
          <declname>enable</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Set the special event character</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>eventch</parametername>
</parameternamelist>
<parameterdescription>
<para>Event character </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>enable</parametername>
</parameternamelist>
<parameterdescription>
<para>0 to disable the event character, non-zero otherwise</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to set event character </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2235" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2233" bodyend="2249"/>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1a50f11e536f110d96eb90687d07e481d5" compoundref="ftdi_8h" startline="140">SIO_SET_EVENT_CHAR_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="classFtdi_1_1Context_1a7471fc6635a9ff2f98d30c5830eb7593" compoundref="ftdi_8cpp" startline="267" endline="270">Ftdi::Context::set_event_char</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gaeb9510a61f6648eb1bd57f0f99a390e1" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_set_error_char</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned char errorch, unsigned char enable)</argsstring>
        <name>ftdi_set_error_char</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned char</type>
          <declname>errorch</declname>
        </param>
        <param>
          <type>unsigned char</type>
          <declname>enable</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Set error character</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>errorch</parametername>
</parameternamelist>
<parameterdescription>
<para>Error character </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>enable</parametername>
</parameternamelist>
<parameterdescription>
<para>0 to disable the error character, non-zero otherwise</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>unable to set error character </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2264" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2262" bodyend="2278"/>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" compoundref="ftdi_8h" startline="233">ftdi_context::index</references>
        <references refid="ftdi_8h_1a5c01e46988dff16f8e0754198443d1f1" compoundref="ftdi_8h" startline="141">SIO_SET_ERROR_CHAR_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="classFtdi_1_1Context_1a5b846e30bb38c78fd772281be7fc342b" compoundref="ftdi_8cpp" startline="272" endline="275">Ftdi::Context::set_error_char</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga0b04717765deb6706482a3f3124c0b4a" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_eeprom_initdefaults</definition>
        <argsstring>(struct ftdi_context *ftdi, char *manufacturer, char *product, char *serial)</argsstring>
        <name>ftdi_eeprom_initdefaults</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>manufacturer</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>product</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>serial</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Init eeprom with default values for the connected device <parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>manufacturer</parametername>
</parameternamelist>
<parameterdescription>
<para>String to use as Manufacturer </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>product</parametername>
</parameternamelist>
<parameterdescription>
<para>String to use as Product description </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>serial</parametername>
</parameternamelist>
<parameterdescription>
<para>String to use as Serial number description</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>No struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>No struct <ref refid="structftdi__eeprom" kindref="compound">ftdi_eeprom</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>No connected device or device not yet opened </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2294" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2292" bodyend="2397"/>
        <references refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" compoundref="ftdi__i_8h" startline="92">ftdi_eeprom::cbus_function</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a1315b5812fad8f70ec7d1a9b7c30533b" compoundref="ftdi_8h" startline="331">CBUS_PWREN</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a6843d248e73c2282a3f1554afec757ea" compoundref="ftdi_8h" startline="331">CBUS_RXLED</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a1316ff4aa58d6b250d3a8d1e61d2afef" compoundref="ftdi_8h" startline="332">CBUS_SLEEP</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a82dad8e9b80ece6a5924b7cccb4825de" compoundref="ftdi_8h" startline="331">CBUS_TXDEN</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a0951f6293488ba4fa6cccde4c3acc7dd" compoundref="ftdi_8h" startline="331">CBUS_TXLED</references>
        <references refid="ftdi_8h_1a5b83df6ac73aeb8f0126ebe2efcebfc2a7be26ae2dd9dfea0b5fa42cdc394fabc" compoundref="ftdi_8h" startline="336">CBUSH_TRISTATE</references>
        <references refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" compoundref="ftdi_8h" startline="243">ftdi_context::eeprom</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__eeprom_1a7a44fb7a64c3114f33561aa6214e5182" compoundref="ftdi__i_8h" startline="39">ftdi_eeprom::initialized_for_connected_device</references>
        <references refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" compoundref="ftdi__i_8h" startline="68">ftdi_eeprom::manufacturer</references>
        <references refid="structftdi__eeprom_1a8aa39af43a6ac5c05b8682d8b3904e3c" compoundref="ftdi__i_8h" startline="65">ftdi_eeprom::max_power</references>
        <references refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" compoundref="ftdi__i_8h" startline="70">ftdi_eeprom::product</references>
        <references refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" compoundref="ftdi__i_8h" startline="35">ftdi_eeprom::product_id</references>
        <references refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" compoundref="ftdi__i_8h" startline="72">ftdi_eeprom::serial</references>
        <references refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" compoundref="ftdi__i_8h" startline="128">ftdi_eeprom::size</references>
        <references refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" compoundref="ftdi_8h" startline="211">ftdi_context::type</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" compoundref="ftdi_8h" startline="24">TYPE_2232C</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" compoundref="ftdi_8h" startline="24">TYPE_2232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" compoundref="ftdi_8h" startline="24">TYPE_232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" compoundref="ftdi_8h" startline="24">TYPE_4232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" compoundref="ftdi_8h" startline="24">TYPE_AM</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" compoundref="ftdi_8h" startline="24">TYPE_BM</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" compoundref="ftdi_8h" startline="24">TYPE_R</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" compoundref="ftdi__i_8h" startline="61">ftdi_eeprom::usb_version</references>
        <references refid="structftdi__eeprom_1abe250275595d020fd8de3aa61d093d38" compoundref="ftdi__i_8h" startline="59">ftdi_eeprom::use_serial</references>
        <references refid="structftdi__eeprom_1af591e992b9bd12a484ea9d4d36e92251" compoundref="ftdi__i_8h" startline="33">ftdi_eeprom::vendor_id</references>
        <referencedby refid="classFtdi_1_1Eeprom_1a6ebc4425bfe250c61cd303078ad92881" compoundref="ftdi_8cpp" startline="399" endline="402">Ftdi::Eeprom::init_defaults</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga4c5f8b615c0db9ed6deefaf57563e3f5" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void set_ft232h_cbus</definition>
        <argsstring>(struct ftdi_eeprom *eeprom, unsigned char *output)</argsstring>
        <name>set_ft232h_cbus</name>
        <param>
          <type>struct <ref refid="structftdi__eeprom" kindref="compound">ftdi_eeprom</ref> *</type>
          <declname>eeprom</declname>
        </param>
        <param>
          <type>unsigned char *</type>
          <declname>output</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2400" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2399" bodyend="2416"/>
        <references refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" compoundref="ftdi__i_8h" startline="92">ftdi_eeprom::cbus_function</references>
        <references refid="ftdi_8h_1a5b83df6ac73aeb8f0126ebe2efcebfc2a2d2d141e7e78469b4aff505263231a87" compoundref="ftdi_8h" startline="338">CBUSH_CLK7_5</references>
        <references refid="ftdi_8h_1a5b83df6ac73aeb8f0126ebe2efcebfc2a7be26ae2dd9dfea0b5fa42cdc394fabc" compoundref="ftdi_8h" startline="336">CBUSH_TRISTATE</references>
        <referencedby refid="group__libftdi_1gaccf7f39923b4a9bbc626cca9f7ac40b1" compoundref="ftdi_8c" startline="2467" endline="2987">ftdi_eeprom_build</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga5f8ad89b8dacf7c46c690212484821dd" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>unsigned char</type>
        <definition>static unsigned char type2bit</definition>
        <argsstring>(unsigned char type, enum ftdi_chip_type chip)</argsstring>
        <name>type2bit</name>
        <param>
          <type>unsigned char</type>
          <declname>type</declname>
        </param>
        <param>
          <type>enum <ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ce" kindref="member">ftdi_chip_type</ref></type>
          <declname>chip</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2421" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2420" bodyend="2451"/>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gaccf7f39923b4a9bbc626cca9f7ac40b1" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_eeprom_build</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_eeprom_build</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Build binary buffer from <ref refid="structftdi__eeprom" kindref="compound">ftdi_eeprom</ref> structure. Output is suitable for <ref refid="group__libftdi_1ga8cc9811660d1adfb4b30157c5ab26d5a" kindref="member">ftdi_write_eeprom()</ref>.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>&gt;=0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>size of eeprom user area in bytes </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>eeprom size (128 bytes) exceeded by custom strings </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Invalid eeprom or ftdi pointer </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Invalid cbus function setting (FIXME: Not in the code?) </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-4</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Chip doesn&apos;t support invert (FIXME: Not in the code?) </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-5</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Chip doesn&apos;t support high current drive (FIXME: Not in the code?) </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-6</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>No connected EEPROM or EEPROM Type unknown </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2468" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2467" bodyend="2987"/>
        <references refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" compoundref="ftdi__i_8h" startline="131">ftdi_eeprom::buf</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a192d6684008401d4be18a17cab683741" compoundref="ftdi_8h" startline="333">CBUS_BB</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2ae8a6b1ed842c6c54b8251e2579a3fd98" compoundref="ftdi_8h" startline="332">CBUS_CLK6</references>
        <references refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" compoundref="ftdi__i_8h" startline="92">ftdi_eeprom::cbus_function</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a1315b5812fad8f70ec7d1a9b7c30533b" compoundref="ftdi_8h" startline="331">CBUS_PWREN</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a6843d248e73c2282a3f1554afec757ea" compoundref="ftdi_8h" startline="331">CBUS_RXLED</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a1316ff4aa58d6b250d3a8d1e61d2afef" compoundref="ftdi_8h" startline="332">CBUS_SLEEP</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a82dad8e9b80ece6a5924b7cccb4825de" compoundref="ftdi_8h" startline="331">CBUS_TXDEN</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a0951f6293488ba4fa6cccde4c3acc7dd" compoundref="ftdi_8h" startline="331">CBUS_TXLED</references>
        <references refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" compoundref="ftdi__i_8h" startline="80">ftdi_eeprom::channel_a_driver</references>
        <references refid="structftdi__eeprom_1ac26b22453035924c2149689b07f8fae8" compoundref="ftdi__i_8h" startline="85">ftdi_eeprom::channel_a_rs485enable</references>
        <references refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" compoundref="ftdi__i_8h" startline="77">ftdi_eeprom::channel_a_type</references>
        <references refid="structftdi__eeprom_1a128def5dc4387fdcdaddaa7c9f460637" compoundref="ftdi__i_8h" startline="81">ftdi_eeprom::channel_b_driver</references>
        <references refid="structftdi__eeprom_1aec61d454c0f8bc1c810aa5682e9fe12a" compoundref="ftdi__i_8h" startline="86">ftdi_eeprom::channel_b_rs485enable</references>
        <references refid="structftdi__eeprom_1a2da524307ba5904880ba6e2456adc4c1" compoundref="ftdi__i_8h" startline="78">ftdi_eeprom::channel_b_type</references>
        <references refid="structftdi__eeprom_1ae08edaf6d0e878a3f9e08e428ac1612d" compoundref="ftdi__i_8h" startline="82">ftdi_eeprom::channel_c_driver</references>
        <references refid="structftdi__eeprom_1a2c8f96a24402a0f8b8a4e9b34f137142" compoundref="ftdi__i_8h" startline="87">ftdi_eeprom::channel_c_rs485enable</references>
        <references refid="structftdi__eeprom_1aea0a7b1821735930d82f24f5f0b6a006" compoundref="ftdi__i_8h" startline="83">ftdi_eeprom::channel_d_driver</references>
        <references refid="structftdi__eeprom_1a6b073acb642e6053c74ec2238942adb4" compoundref="ftdi__i_8h" startline="88">ftdi_eeprom::channel_d_rs485enable</references>
        <references refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" compoundref="ftdi_8h" startline="364">CHANNEL_IS_RS485</references>
        <references refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" compoundref="ftdi__i_8h" startline="130">ftdi_eeprom::chip</references>
        <references refid="structftdi__eeprom_1a55c072e8789a611a3842296ca1ac5171" compoundref="ftdi__i_8h" startline="122">ftdi_eeprom::clock_polarity</references>
        <references refid="structftdi__eeprom_1a8a1f5de674bbd131e42e924ead65c617" compoundref="ftdi__i_8h" startline="123">ftdi_eeprom::data_order</references>
        <references refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" compoundref="ftdi_8h" startline="369">DRIVE_16MA</references>
        <references refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" compoundref="ftdi_8h" startline="374">DRIVER_VCP</references>
        <references refid="ftdi_8h_1a5da3119ded0e1994a3d4fcd78da2eb6c" compoundref="ftdi_8h" startline="375">DRIVER_VCPH</references>
        <references refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" compoundref="ftdi_8h" startline="243">ftdi_context::eeprom</references>
        <references refid="structftdi__eeprom_1a85d03dc6aa088d929eea3c7b6b7c5741" compoundref="ftdi__i_8h" startline="124">ftdi_eeprom::flow_control</references>
        <references refid="ftdi_8h_1a1a6dd2fedbead82493fd1d8fbf702c91" compoundref="ftdi_8h" startline="324">FT1284_CLK_IDLE_STATE</references>
        <references refid="ftdi_8h_1a5b08fd32976ca0ba42f66832fdb19a8b" compoundref="ftdi_8h" startline="325">FT1284_DATA_LSB</references>
        <references refid="ftdi_8h_1a92220e6661b8fa1d8eac57fda958239c" compoundref="ftdi_8h" startline="326">FT1284_FLOW_CONTROL</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="ftdi__i_8h_1a0c61fd6cfc8b3ec904d270a7980e8f37" compoundref="ftdi__i_8h" startline="22">FTDI_MAX_EEPROM_SIZE</references>
        <references refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" compoundref="ftdi__i_8h" startline="107">ftdi_eeprom::group0_drive</references>
        <references refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" compoundref="ftdi__i_8h" startline="108">ftdi_eeprom::group0_schmitt</references>
        <references refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" compoundref="ftdi__i_8h" startline="109">ftdi_eeprom::group0_slew</references>
        <references refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" compoundref="ftdi__i_8h" startline="110">ftdi_eeprom::group1_drive</references>
        <references refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" compoundref="ftdi__i_8h" startline="111">ftdi_eeprom::group1_schmitt</references>
        <references refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" compoundref="ftdi__i_8h" startline="112">ftdi_eeprom::group1_slew</references>
        <references refid="structftdi__eeprom_1a58cb0545a65f6f0bf431e186f1b44f71" compoundref="ftdi__i_8h" startline="113">ftdi_eeprom::group2_drive</references>
        <references refid="structftdi__eeprom_1aa6c5c7b16e649d70e358b021ad0c469e" compoundref="ftdi__i_8h" startline="114">ftdi_eeprom::group2_schmitt</references>
        <references refid="structftdi__eeprom_1ab69800fef64ca3d55449eab4322e5090" compoundref="ftdi__i_8h" startline="115">ftdi_eeprom::group2_slew</references>
        <references refid="structftdi__eeprom_1ae5c54d334e18338296557572deee7433" compoundref="ftdi__i_8h" startline="116">ftdi_eeprom::group3_drive</references>
        <references refid="structftdi__eeprom_1a7afc69623874f8b64614f2688f08033e" compoundref="ftdi__i_8h" startline="117">ftdi_eeprom::group3_schmitt</references>
        <references refid="structftdi__eeprom_1a13e5b314e0a2c1e0a67f6bb31ac07f5a" compoundref="ftdi__i_8h" startline="118">ftdi_eeprom::group3_slew</references>
        <references refid="structftdi__eeprom_1ad377261e985c768c2ca5731e9690efd9" compoundref="ftdi__i_8h" startline="94">ftdi_eeprom::high_current</references>
        <references refid="structftdi__eeprom_1a4bf7b50ec4259aa83623bc9ed789c429" compoundref="ftdi__i_8h" startline="96">ftdi_eeprom::high_current_a</references>
        <references refid="structftdi__eeprom_1a5016f08e6af06307abe71c15165d24ab" compoundref="ftdi__i_8h" startline="98">ftdi_eeprom::high_current_b</references>
        <references refid="ftdi_8h_1a0b41f0434b3f10219bfbfc0ae02d60a0" compoundref="ftdi_8h" startline="382">HIGH_CURRENT_DRIVE</references>
        <references refid="ftdi_8h_1adce93ce221bc8772e8149981be6ee5a7" compoundref="ftdi_8h" startline="383">HIGH_CURRENT_DRIVE_R</references>
        <references refid="structftdi__eeprom_1a5117b50c00668aff73b5df385b0fc5f8" compoundref="ftdi__i_8h" startline="52">ftdi_eeprom::in_is_isochronous</references>
        <references refid="structftdi__eeprom_1a4876d3d01242d7c3b2961b1a42b35509" compoundref="ftdi__i_8h" startline="100">ftdi_eeprom::invert</references>
        <references refid="structftdi__eeprom_1a30dad8c71143befc6f947bcf04e63aa2" compoundref="ftdi__i_8h" startline="46">ftdi_eeprom::is_not_pnp</references>
        <references refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" compoundref="ftdi_8h" startline="371">IS_SCHMITT</references>
        <references refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" compoundref="ftdi__i_8h" startline="68">ftdi_eeprom::manufacturer</references>
        <references refid="structftdi__eeprom_1a8aa39af43a6ac5c05b8682d8b3904e3c" compoundref="ftdi__i_8h" startline="65">ftdi_eeprom::max_power</references>
        <references refid="ftdi__i_8h_1ad4d084064eecf35f2bcaeae257f9d517" compoundref="ftdi__i_8h" startline="25">MAX_POWER_MILLIAMP_PER_UNIT</references>
        <references refid="structftdi__eeprom_1ab9885ee665c318a8d19c28a9c75b999a" compoundref="ftdi__i_8h" startline="54">ftdi_eeprom::out_is_isochronous</references>
        <references refid="ftdi_8h_1a7fe7b5606c0cc443ec8813a562e3c6ca" compoundref="ftdi_8h" startline="327">POWER_SAVE_DISABLE_H</references>
        <references refid="structftdi__eeprom_1acbaa0dac427977d4f8fcd735a34bf2c3" compoundref="ftdi__i_8h" startline="120">ftdi_eeprom::powersave</references>
        <references refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" compoundref="ftdi__i_8h" startline="70">ftdi_eeprom::product</references>
        <references refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" compoundref="ftdi__i_8h" startline="35">ftdi_eeprom::product_id</references>
        <references refid="structftdi__eeprom_1a9b82f88497b432bebfa4dd92c304cb02" compoundref="ftdi__i_8h" startline="44">ftdi_eeprom::remote_wakeup</references>
        <references refid="structftdi__eeprom_1a055d6bef2328557e6ac4d2909e42d21b" compoundref="ftdi__i_8h" startline="42">ftdi_eeprom::self_powered</references>
        <references refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" compoundref="ftdi__i_8h" startline="72">ftdi_eeprom::serial</references>
        <references refid="group__libftdi_1ga4c5f8b615c0db9ed6deefaf57563e3f5" compoundref="ftdi_8c" startline="2399" endline="2416">set_ft232h_cbus</references>
        <references refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" compoundref="ftdi__i_8h" startline="128">ftdi_eeprom::size</references>
        <references refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" compoundref="ftdi_8h" startline="370">SLOW_SLEW</references>
        <references refid="structftdi__eeprom_1afc46f39449462d10f9b8992523214136" compoundref="ftdi__i_8h" startline="49">ftdi_eeprom::suspend_dbus7</references>
        <references refid="ftdi_8h_1ada79600bc57b36a0ab93a8fbd834b8b9" compoundref="ftdi_8h" startline="379">SUSPEND_DBUS7_BIT</references>
        <references refid="structftdi__eeprom_1a722a630d370318cefa94de1365f98786" compoundref="ftdi__i_8h" startline="56">ftdi_eeprom::suspend_pull_downs</references>
        <references refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" compoundref="ftdi_8h" startline="211">ftdi_context::type</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" compoundref="ftdi_8h" startline="24">TYPE_2232C</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" compoundref="ftdi_8h" startline="24">TYPE_2232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" compoundref="ftdi_8h" startline="24">TYPE_232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" compoundref="ftdi_8h" startline="24">TYPE_4232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" compoundref="ftdi_8h" startline="24">TYPE_AM</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" compoundref="ftdi_8h" startline="24">TYPE_BM</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" compoundref="ftdi_8h" startline="24">TYPE_R</references>
        <references refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" compoundref="ftdi__i_8h" startline="61">ftdi_eeprom::usb_version</references>
        <references refid="structftdi__eeprom_1abe250275595d020fd8de3aa61d093d38" compoundref="ftdi__i_8h" startline="59">ftdi_eeprom::use_serial</references>
        <references refid="ftdi_8h_1a100304658f531729f8961ac2b5609fb1" compoundref="ftdi_8h" startline="329">USE_SERIAL_NUM</references>
        <references refid="structftdi__eeprom_1a54772c4686e082384adee26eeaa68005" compoundref="ftdi__i_8h" startline="63">ftdi_eeprom::use_usb_version</references>
        <references refid="ftdi_8h_1ae6a585cfccd26ea11cb195877d49b211" compoundref="ftdi_8h" startline="377">USE_USB_VERSION_BIT</references>
        <references refid="structftdi__eeprom_1af591e992b9bd12a484ea9d4d36e92251" compoundref="ftdi__i_8h" startline="33">ftdi_eeprom::vendor_id</references>
        <referencedby refid="classFtdi_1_1Eeprom_1abddb318d9df2c626fffa09047d5ab549" compoundref="ftdi_8cpp" startline="409" endline="412">Ftdi::Eeprom::build</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gacfd8e756664dbbd52ce62c292a7b5d0d" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>unsigned char</type>
        <definition>static unsigned char bit2type</definition>
        <argsstring>(unsigned char bits)</argsstring>
        <name>bit2type</name>
        <param>
          <type>unsigned char</type>
          <declname>bits</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="2994" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="2993" bodyend="3007"/>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gac91c95ae42ec1ba885dc54f39709c072" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_eeprom_decode</definition>
        <argsstring>(struct ftdi_context *ftdi, int verbose)</argsstring>
        <name>ftdi_eeprom_decode</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>int</type>
          <declname>verbose</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Decode binary EEPROM image into an <ref refid="structftdi__eeprom" kindref="compound">ftdi_eeprom</ref> structure.</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>verbose</parametername>
</parameternamelist>
<parameterdescription>
<para>Decode EEPROM on stdout</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>something went wrong</para></parameterdescription>
</parameteritem>
</parameterlist>
FIXME: How to pass size? How to handle size field in <ref refid="structftdi__eeprom" kindref="compound">ftdi_eeprom</ref>? FIXME: Strings are malloc&apos;ed here and should be freed somewhere </para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="3021" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="3020" bodyend="3398"/>
        <references refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" compoundref="ftdi__i_8h" startline="131">ftdi_eeprom::buf</references>
        <references refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a192d6684008401d4be18a17cab683741" compoundref="ftdi_8h" startline="333">CBUS_BB</references>
        <references refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" compoundref="ftdi__i_8h" startline="92">ftdi_eeprom::cbus_function</references>
        <references refid="ftdi_8h_1a5b83df6ac73aeb8f0126ebe2efcebfc2a2d2d141e7e78469b4aff505263231a87" compoundref="ftdi_8h" startline="338">CBUSH_CLK7_5</references>
        <references refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" compoundref="ftdi__i_8h" startline="80">ftdi_eeprom::channel_a_driver</references>
        <references refid="structftdi__eeprom_1ac26b22453035924c2149689b07f8fae8" compoundref="ftdi__i_8h" startline="85">ftdi_eeprom::channel_a_rs485enable</references>
        <references refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" compoundref="ftdi__i_8h" startline="77">ftdi_eeprom::channel_a_type</references>
        <references refid="structftdi__eeprom_1a128def5dc4387fdcdaddaa7c9f460637" compoundref="ftdi__i_8h" startline="81">ftdi_eeprom::channel_b_driver</references>
        <references refid="structftdi__eeprom_1aec61d454c0f8bc1c810aa5682e9fe12a" compoundref="ftdi__i_8h" startline="86">ftdi_eeprom::channel_b_rs485enable</references>
        <references refid="structftdi__eeprom_1a2da524307ba5904880ba6e2456adc4c1" compoundref="ftdi__i_8h" startline="78">ftdi_eeprom::channel_b_type</references>
        <references refid="structftdi__eeprom_1ae08edaf6d0e878a3f9e08e428ac1612d" compoundref="ftdi__i_8h" startline="82">ftdi_eeprom::channel_c_driver</references>
        <references refid="structftdi__eeprom_1a2c8f96a24402a0f8b8a4e9b34f137142" compoundref="ftdi__i_8h" startline="87">ftdi_eeprom::channel_c_rs485enable</references>
        <references refid="structftdi__eeprom_1aea0a7b1821735930d82f24f5f0b6a006" compoundref="ftdi__i_8h" startline="83">ftdi_eeprom::channel_d_driver</references>
        <references refid="structftdi__eeprom_1a6b073acb642e6053c74ec2238942adb4" compoundref="ftdi__i_8h" startline="88">ftdi_eeprom::channel_d_rs485enable</references>
        <references refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" compoundref="ftdi_8h" startline="364">CHANNEL_IS_RS485</references>
        <references refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" compoundref="ftdi__i_8h" startline="130">ftdi_eeprom::chip</references>
        <references refid="structftdi__eeprom_1a55c072e8789a611a3842296ca1ac5171" compoundref="ftdi__i_8h" startline="122">ftdi_eeprom::clock_polarity</references>
        <references refid="structftdi__eeprom_1a8a1f5de674bbd131e42e924ead65c617" compoundref="ftdi__i_8h" startline="123">ftdi_eeprom::data_order</references>
        <references refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" compoundref="ftdi_8h" startline="369">DRIVE_16MA</references>
        <references refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" compoundref="ftdi_8h" startline="374">DRIVER_VCP</references>
        <references refid="ftdi_8h_1a5da3119ded0e1994a3d4fcd78da2eb6c" compoundref="ftdi_8h" startline="375">DRIVER_VCPH</references>
        <references refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" compoundref="ftdi_8h" startline="243">ftdi_context::eeprom</references>
        <references refid="structftdi__eeprom_1a85d03dc6aa088d929eea3c7b6b7c5741" compoundref="ftdi__i_8h" startline="124">ftdi_eeprom::flow_control</references>
        <references refid="ftdi_8h_1a1a6dd2fedbead82493fd1d8fbf702c91" compoundref="ftdi_8h" startline="324">FT1284_CLK_IDLE_STATE</references>
        <references refid="ftdi_8h_1a5b08fd32976ca0ba42f66832fdb19a8b" compoundref="ftdi_8h" startline="325">FT1284_DATA_LSB</references>
        <references refid="ftdi_8h_1a92220e6661b8fa1d8eac57fda958239c" compoundref="ftdi_8h" startline="326">FT1284_FLOW_CONTROL</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" compoundref="ftdi__i_8h" startline="107">ftdi_eeprom::group0_drive</references>
        <references refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" compoundref="ftdi__i_8h" startline="108">ftdi_eeprom::group0_schmitt</references>
        <references refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" compoundref="ftdi__i_8h" startline="109">ftdi_eeprom::group0_slew</references>
        <references refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" compoundref="ftdi__i_8h" startline="110">ftdi_eeprom::group1_drive</references>
        <references refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" compoundref="ftdi__i_8h" startline="111">ftdi_eeprom::group1_schmitt</references>
        <references refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" compoundref="ftdi__i_8h" startline="112">ftdi_eeprom::group1_slew</references>
        <references refid="structftdi__eeprom_1a58cb0545a65f6f0bf431e186f1b44f71" compoundref="ftdi__i_8h" startline="113">ftdi_eeprom::group2_drive</references>
        <references refid="structftdi__eeprom_1aa6c5c7b16e649d70e358b021ad0c469e" compoundref="ftdi__i_8h" startline="114">ftdi_eeprom::group2_schmitt</references>
        <references refid="structftdi__eeprom_1ab69800fef64ca3d55449eab4322e5090" compoundref="ftdi__i_8h" startline="115">ftdi_eeprom::group2_slew</references>
        <references refid="structftdi__eeprom_1ae5c54d334e18338296557572deee7433" compoundref="ftdi__i_8h" startline="116">ftdi_eeprom::group3_drive</references>
        <references refid="structftdi__eeprom_1a7afc69623874f8b64614f2688f08033e" compoundref="ftdi__i_8h" startline="117">ftdi_eeprom::group3_schmitt</references>
        <references refid="structftdi__eeprom_1a13e5b314e0a2c1e0a67f6bb31ac07f5a" compoundref="ftdi__i_8h" startline="118">ftdi_eeprom::group3_slew</references>
        <references refid="structftdi__eeprom_1ad377261e985c768c2ca5731e9690efd9" compoundref="ftdi__i_8h" startline="94">ftdi_eeprom::high_current</references>
        <references refid="structftdi__eeprom_1a4bf7b50ec4259aa83623bc9ed789c429" compoundref="ftdi__i_8h" startline="96">ftdi_eeprom::high_current_a</references>
        <references refid="structftdi__eeprom_1a5016f08e6af06307abe71c15165d24ab" compoundref="ftdi__i_8h" startline="98">ftdi_eeprom::high_current_b</references>
        <references refid="ftdi_8h_1a0b41f0434b3f10219bfbfc0ae02d60a0" compoundref="ftdi_8h" startline="382">HIGH_CURRENT_DRIVE</references>
        <references refid="ftdi_8h_1adce93ce221bc8772e8149981be6ee5a7" compoundref="ftdi_8h" startline="383">HIGH_CURRENT_DRIVE_R</references>
        <references refid="structftdi__eeprom_1a5117b50c00668aff73b5df385b0fc5f8" compoundref="ftdi__i_8h" startline="52">ftdi_eeprom::in_is_isochronous</references>
        <references refid="structftdi__eeprom_1a4876d3d01242d7c3b2961b1a42b35509" compoundref="ftdi__i_8h" startline="100">ftdi_eeprom::invert</references>
        <references refid="structftdi__eeprom_1a30dad8c71143befc6f947bcf04e63aa2" compoundref="ftdi__i_8h" startline="46">ftdi_eeprom::is_not_pnp</references>
        <references refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" compoundref="ftdi_8h" startline="371">IS_SCHMITT</references>
        <references refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" compoundref="ftdi__i_8h" startline="68">ftdi_eeprom::manufacturer</references>
        <references refid="structftdi__eeprom_1a8aa39af43a6ac5c05b8682d8b3904e3c" compoundref="ftdi__i_8h" startline="65">ftdi_eeprom::max_power</references>
        <references refid="ftdi__i_8h_1ad4d084064eecf35f2bcaeae257f9d517" compoundref="ftdi__i_8h" startline="25">MAX_POWER_MILLIAMP_PER_UNIT</references>
        <references refid="structftdi__eeprom_1ab9885ee665c318a8d19c28a9c75b999a" compoundref="ftdi__i_8h" startline="54">ftdi_eeprom::out_is_isochronous</references>
        <references refid="ftdi_8h_1a7fe7b5606c0cc443ec8813a562e3c6ca" compoundref="ftdi_8h" startline="327">POWER_SAVE_DISABLE_H</references>
        <references refid="structftdi__eeprom_1acbaa0dac427977d4f8fcd735a34bf2c3" compoundref="ftdi__i_8h" startline="120">ftdi_eeprom::powersave</references>
        <references refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" compoundref="ftdi__i_8h" startline="70">ftdi_eeprom::product</references>
        <references refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" compoundref="ftdi__i_8h" startline="35">ftdi_eeprom::product_id</references>
        <references refid="structftdi__eeprom_1a9b82f88497b432bebfa4dd92c304cb02" compoundref="ftdi__i_8h" startline="44">ftdi_eeprom::remote_wakeup</references>
        <references refid="structftdi__eeprom_1a055d6bef2328557e6ac4d2909e42d21b" compoundref="ftdi__i_8h" startline="42">ftdi_eeprom::self_powered</references>
        <references refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" compoundref="ftdi__i_8h" startline="72">ftdi_eeprom::serial</references>
        <references refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" compoundref="ftdi__i_8h" startline="128">ftdi_eeprom::size</references>
        <references refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" compoundref="ftdi_8h" startline="370">SLOW_SLEW</references>
        <references refid="structftdi__eeprom_1afc46f39449462d10f9b8992523214136" compoundref="ftdi__i_8h" startline="49">ftdi_eeprom::suspend_dbus7</references>
        <references refid="ftdi_8h_1ada79600bc57b36a0ab93a8fbd834b8b9" compoundref="ftdi_8h" startline="379">SUSPEND_DBUS7_BIT</references>
        <references refid="structftdi__eeprom_1a722a630d370318cefa94de1365f98786" compoundref="ftdi__i_8h" startline="56">ftdi_eeprom::suspend_pull_downs</references>
        <references refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" compoundref="ftdi_8h" startline="211">ftdi_context::type</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" compoundref="ftdi_8h" startline="24">TYPE_2232C</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" compoundref="ftdi_8h" startline="24">TYPE_2232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" compoundref="ftdi_8h" startline="24">TYPE_232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" compoundref="ftdi_8h" startline="24">TYPE_4232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" compoundref="ftdi_8h" startline="24">TYPE_AM</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" compoundref="ftdi_8h" startline="24">TYPE_BM</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" compoundref="ftdi_8h" startline="24">TYPE_R</references>
        <references refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" compoundref="ftdi__i_8h" startline="61">ftdi_eeprom::usb_version</references>
        <references refid="structftdi__eeprom_1abe250275595d020fd8de3aa61d093d38" compoundref="ftdi__i_8h" startline="59">ftdi_eeprom::use_serial</references>
        <references refid="ftdi_8h_1a100304658f531729f8961ac2b5609fb1" compoundref="ftdi_8h" startline="329">USE_SERIAL_NUM</references>
        <references refid="structftdi__eeprom_1a54772c4686e082384adee26eeaa68005" compoundref="ftdi__i_8h" startline="63">ftdi_eeprom::use_usb_version</references>
        <references refid="ftdi_8h_1ae6a585cfccd26ea11cb195877d49b211" compoundref="ftdi_8h" startline="377">USE_USB_VERSION_BIT</references>
        <references refid="structftdi__eeprom_1af591e992b9bd12a484ea9d4d36e92251" compoundref="ftdi__i_8h" startline="33">ftdi_eeprom::vendor_id</references>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga6213209895e40153d103a72654d53b81" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_get_eeprom_value</definition>
        <argsstring>(struct ftdi_context *ftdi, enum ftdi_eeprom_value value_name, int *value)</argsstring>
        <name>ftdi_get_eeprom_value</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>enum <ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cd" kindref="member">ftdi_eeprom_value</ref></type>
          <declname>value_name</declname>
        </param>
        <param>
          <type>int *</type>
          <declname>value</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Get a value from the decoded EEPROM structure</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>value_name</parametername>
</parameternamelist>
<parameterdescription>
<para>Enum of the value to query </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>value</parametername>
</parameternamelist>
<parameterdescription>
<para>Pointer to store read value</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Value doesn&apos;t exist </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="3411" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="3410" bodyend="3583"/>
        <references refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" compoundref="ftdi__i_8h" startline="92">ftdi_eeprom::cbus_function</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdadec48df2aacb6daa4523f4fc6e09032b" compoundref="ftdi_8h" startline="274">CBUS_FUNCTION_0</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda7dd4d452169ab40e99c849f1b4ed4110" compoundref="ftdi_8h" startline="275">CBUS_FUNCTION_1</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda307435ed7db2708581a0e86eb180200c" compoundref="ftdi_8h" startline="276">CBUS_FUNCTION_2</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdabe2751f6a199a5686b80da1eda17d871" compoundref="ftdi_8h" startline="277">CBUS_FUNCTION_3</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda5e97bbd3da3aa1aa171bf33a7a9307d1" compoundref="ftdi_8h" startline="278">CBUS_FUNCTION_4</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdad39c5f41d1d70a9296ae14b3e8681c53" compoundref="ftdi_8h" startline="279">CBUS_FUNCTION_5</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda0785c792f5ea33548404dfc19e39176b" compoundref="ftdi_8h" startline="280">CBUS_FUNCTION_6</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdac4b158896f5efa2e5f1afef2532f2adf" compoundref="ftdi_8h" startline="281">CBUS_FUNCTION_7</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1d27121cb964655a42a066a188c690d2" compoundref="ftdi_8h" startline="282">CBUS_FUNCTION_8</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda0848e6d92df2404a9c1c9010ebba972d" compoundref="ftdi_8h" startline="283">CBUS_FUNCTION_9</references>
        <references refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" compoundref="ftdi__i_8h" startline="80">ftdi_eeprom::channel_a_driver</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda9764d3fb2ce5d3eff6f743dd8cfe1395" compoundref="ftdi_8h" startline="272">CHANNEL_A_DRIVER</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaee98eeb2d224f9b2c7dffc9951766ddf" compoundref="ftdi_8h" startline="308">CHANNEL_A_RS485</references>
        <references refid="structftdi__eeprom_1ac26b22453035924c2149689b07f8fae8" compoundref="ftdi__i_8h" startline="85">ftdi_eeprom::channel_a_rs485enable</references>
        <references refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" compoundref="ftdi__i_8h" startline="77">ftdi_eeprom::channel_a_type</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda86c1629835d45789c2bf3a7ee2fa7164" compoundref="ftdi_8h" startline="270">CHANNEL_A_TYPE</references>
        <references refid="structftdi__eeprom_1a128def5dc4387fdcdaddaa7c9f460637" compoundref="ftdi__i_8h" startline="81">ftdi_eeprom::channel_b_driver</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda277bd50fdc3904c70fb6851850469f21" compoundref="ftdi_8h" startline="273">CHANNEL_B_DRIVER</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda0193b368cbac2a9e7212d036532970f8" compoundref="ftdi_8h" startline="309">CHANNEL_B_RS485</references>
        <references refid="structftdi__eeprom_1aec61d454c0f8bc1c810aa5682e9fe12a" compoundref="ftdi__i_8h" startline="86">ftdi_eeprom::channel_b_rs485enable</references>
        <references refid="structftdi__eeprom_1a2da524307ba5904880ba6e2456adc4c1" compoundref="ftdi__i_8h" startline="78">ftdi_eeprom::channel_b_type</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda7ca539644f82b44fc59004dec38d3f43" compoundref="ftdi_8h" startline="271">CHANNEL_B_TYPE</references>
        <references refid="structftdi__eeprom_1ae08edaf6d0e878a3f9e08e428ac1612d" compoundref="ftdi__i_8h" startline="82">ftdi_eeprom::channel_c_driver</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda433b65c4524f72ee39083345b0f15a93" compoundref="ftdi_8h" startline="306">CHANNEL_C_DRIVER</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda2c2c59d298e324f9134e0e0aa7a2b6d2" compoundref="ftdi_8h" startline="310">CHANNEL_C_RS485</references>
        <references refid="structftdi__eeprom_1a2c8f96a24402a0f8b8a4e9b34f137142" compoundref="ftdi__i_8h" startline="87">ftdi_eeprom::channel_c_rs485enable</references>
        <references refid="structftdi__eeprom_1aea0a7b1821735930d82f24f5f0b6a006" compoundref="ftdi__i_8h" startline="83">ftdi_eeprom::channel_d_driver</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1f94c84fbd97ca5aceceff5303914219" compoundref="ftdi_8h" startline="307">CHANNEL_D_DRIVER</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda7c62d86e2e2dbb3cb0d05ac67eed71e0" compoundref="ftdi_8h" startline="311">CHANNEL_D_RS485</references>
        <references refid="structftdi__eeprom_1a6b073acb642e6053c74ec2238942adb4" compoundref="ftdi__i_8h" startline="88">ftdi_eeprom::channel_d_rs485enable</references>
        <references refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" compoundref="ftdi__i_8h" startline="130">ftdi_eeprom::chip</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda381285b7c4454a1f04d43887b55a76b9" compoundref="ftdi_8h" startline="300">CHIP_SIZE</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdab3160717262b754c6d4895cd9a3daf2e" compoundref="ftdi_8h" startline="301">CHIP_TYPE</references>
        <references refid="structftdi__eeprom_1a55c072e8789a611a3842296ca1ac5171" compoundref="ftdi__i_8h" startline="122">ftdi_eeprom::clock_polarity</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda54b3c39afc0140c234654d1738f0f18c" compoundref="ftdi_8h" startline="303">CLOCK_POLARITY</references>
        <references refid="structftdi__eeprom_1a8a1f5de674bbd131e42e924ead65c617" compoundref="ftdi__i_8h" startline="123">ftdi_eeprom::data_order</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1ecdc817b75811273206a5dededf4ddb" compoundref="ftdi_8h" startline="304">DATA_ORDER</references>
        <references refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" compoundref="ftdi_8h" startline="243">ftdi_context::eeprom</references>
        <references refid="structftdi__eeprom_1a85d03dc6aa088d929eea3c7b6b7c5741" compoundref="ftdi__i_8h" startline="124">ftdi_eeprom::flow_control</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1bc9ce65b7a27fdf832b69aef487b6b1" compoundref="ftdi_8h" startline="305">FLOW_CONTROL</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" compoundref="ftdi__i_8h" startline="107">ftdi_eeprom::group0_drive</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdae603ca8f2ed0811de45a9822fe10e405" compoundref="ftdi_8h" startline="288">GROUP0_DRIVE</references>
        <references refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" compoundref="ftdi__i_8h" startline="108">ftdi_eeprom::group0_schmitt</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaaabac9a535a103060a0b2a972985b2ec" compoundref="ftdi_8h" startline="289">GROUP0_SCHMITT</references>
        <references refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" compoundref="ftdi__i_8h" startline="109">ftdi_eeprom::group0_slew</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda5e99a23ccf517c4846f1ccbf99539009" compoundref="ftdi_8h" startline="290">GROUP0_SLEW</references>
        <references refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" compoundref="ftdi__i_8h" startline="110">ftdi_eeprom::group1_drive</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaf4659c175213672ec8390fef0e846822" compoundref="ftdi_8h" startline="291">GROUP1_DRIVE</references>
        <references refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" compoundref="ftdi__i_8h" startline="111">ftdi_eeprom::group1_schmitt</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda01c1da99b72ec3e60ac6800f5baaf469" compoundref="ftdi_8h" startline="292">GROUP1_SCHMITT</references>
        <references refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" compoundref="ftdi__i_8h" startline="112">ftdi_eeprom::group1_slew</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda8ceab8fc99a4e1ff94c31cf6c8f88028" compoundref="ftdi_8h" startline="293">GROUP1_SLEW</references>
        <references refid="structftdi__eeprom_1a58cb0545a65f6f0bf431e186f1b44f71" compoundref="ftdi__i_8h" startline="113">ftdi_eeprom::group2_drive</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda02006a9fb9f6b3272e60382266f27e6f" compoundref="ftdi_8h" startline="294">GROUP2_DRIVE</references>
        <references refid="structftdi__eeprom_1aa6c5c7b16e649d70e358b021ad0c469e" compoundref="ftdi__i_8h" startline="114">ftdi_eeprom::group2_schmitt</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda18987baccc2899292d93b35d953905f1" compoundref="ftdi_8h" startline="295">GROUP2_SCHMITT</references>
        <references refid="structftdi__eeprom_1ab69800fef64ca3d55449eab4322e5090" compoundref="ftdi__i_8h" startline="115">ftdi_eeprom::group2_slew</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdabbb8cd7178ae1d655a205c8197f5bbdd" compoundref="ftdi_8h" startline="296">GROUP2_SLEW</references>
        <references refid="structftdi__eeprom_1ae5c54d334e18338296557572deee7433" compoundref="ftdi__i_8h" startline="116">ftdi_eeprom::group3_drive</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda954be78df39d339bc94729789f81a03e" compoundref="ftdi_8h" startline="297">GROUP3_DRIVE</references>
        <references refid="structftdi__eeprom_1a7afc69623874f8b64614f2688f08033e" compoundref="ftdi__i_8h" startline="117">ftdi_eeprom::group3_schmitt</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaff4e78fe8f024261c763dc3e3dccc717" compoundref="ftdi_8h" startline="298">GROUP3_SCHMITT</references>
        <references refid="structftdi__eeprom_1a13e5b314e0a2c1e0a67f6bb31ac07f5a" compoundref="ftdi__i_8h" startline="118">ftdi_eeprom::group3_slew</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdae7befb90d908e4035c69dfe8e783e29a" compoundref="ftdi_8h" startline="299">GROUP3_SLEW</references>
        <references refid="structftdi__eeprom_1ad377261e985c768c2ca5731e9690efd9" compoundref="ftdi__i_8h" startline="94">ftdi_eeprom::high_current</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda70b51ab39f14a27a35a89e07bd6807aa" compoundref="ftdi_8h" startline="284">HIGH_CURRENT</references>
        <references refid="structftdi__eeprom_1a4bf7b50ec4259aa83623bc9ed789c429" compoundref="ftdi__i_8h" startline="96">ftdi_eeprom::high_current_a</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda8ec56c968baf80eae5239dba2616868f" compoundref="ftdi_8h" startline="285">HIGH_CURRENT_A</references>
        <references refid="structftdi__eeprom_1a5016f08e6af06307abe71c15165d24ab" compoundref="ftdi__i_8h" startline="98">ftdi_eeprom::high_current_b</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda99f59a21df7285884ce88738d1e97187" compoundref="ftdi_8h" startline="286">HIGH_CURRENT_B</references>
        <references refid="structftdi__eeprom_1a5117b50c00668aff73b5df385b0fc5f8" compoundref="ftdi__i_8h" startline="52">ftdi_eeprom::in_is_isochronous</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda14520ed9a009b332096746b8b014ba84" compoundref="ftdi_8h" startline="263">IN_IS_ISOCHRONOUS</references>
        <references refid="structftdi__eeprom_1a4876d3d01242d7c3b2961b1a42b35509" compoundref="ftdi__i_8h" startline="100">ftdi_eeprom::invert</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdab5f95af56a0f14f0032750594b523c95" compoundref="ftdi_8h" startline="287">INVERT</references>
        <references refid="structftdi__eeprom_1a30dad8c71143befc6f947bcf04e63aa2" compoundref="ftdi__i_8h" startline="46">ftdi_eeprom::is_not_pnp</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda80005060e30959d4d90449f343a0b777" compoundref="ftdi_8h" startline="261">IS_NOT_PNP</references>
        <references refid="structftdi__eeprom_1a8aa39af43a6ac5c05b8682d8b3904e3c" compoundref="ftdi__i_8h" startline="65">ftdi_eeprom::max_power</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda83623d0e379659fb8113d8c5f6394706" compoundref="ftdi_8h" startline="269">MAX_POWER</references>
        <references refid="structftdi__eeprom_1ab9885ee665c318a8d19c28a9c75b999a" compoundref="ftdi__i_8h" startline="54">ftdi_eeprom::out_is_isochronous</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdac3d4167972b6222c4035a259fca7126d" compoundref="ftdi_8h" startline="264">OUT_IS_ISOCHRONOUS</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda412ffca781db3a099f287df487667d19" compoundref="ftdi_8h" startline="302">POWER_SAVE</references>
        <references refid="structftdi__eeprom_1acbaa0dac427977d4f8fcd735a34bf2c3" compoundref="ftdi__i_8h" startline="120">ftdi_eeprom::powersave</references>
        <references refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" compoundref="ftdi__i_8h" startline="35">ftdi_eeprom::product_id</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda6c2d445571c53a6ffaa9ad9e84258e6b" compoundref="ftdi_8h" startline="258">PRODUCT_ID</references>
        <references refid="structftdi__eeprom_1a9b82f88497b432bebfa4dd92c304cb02" compoundref="ftdi__i_8h" startline="44">ftdi_eeprom::remote_wakeup</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda65603b0b33ba5a1cf2fc9abbabf731eb" compoundref="ftdi_8h" startline="260">REMOTE_WAKEUP</references>
        <references refid="structftdi__eeprom_1a055d6bef2328557e6ac4d2909e42d21b" compoundref="ftdi__i_8h" startline="42">ftdi_eeprom::self_powered</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda8921cc2e575c669f3b6116ec6c2946a4" compoundref="ftdi_8h" startline="259">SELF_POWERED</references>
        <references refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" compoundref="ftdi__i_8h" startline="128">ftdi_eeprom::size</references>
        <references refid="structftdi__eeprom_1afc46f39449462d10f9b8992523214136" compoundref="ftdi__i_8h" startline="49">ftdi_eeprom::suspend_dbus7</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda17887eedccc85d83d1ce847be1e433ed" compoundref="ftdi_8h" startline="262">SUSPEND_DBUS7</references>
        <references refid="structftdi__eeprom_1a722a630d370318cefa94de1365f98786" compoundref="ftdi__i_8h" startline="56">ftdi_eeprom::suspend_pull_downs</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda68d4ae93864ec70b19d9cf511d8f05ec" compoundref="ftdi_8h" startline="265">SUSPEND_PULL_DOWNS</references>
        <references refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" compoundref="ftdi__i_8h" startline="61">ftdi_eeprom::usb_version</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda54e6e162c0578b9576d31c069d43f3da" compoundref="ftdi_8h" startline="267">USB_VERSION</references>
        <references refid="structftdi__eeprom_1abe250275595d020fd8de3aa61d093d38" compoundref="ftdi__i_8h" startline="59">ftdi_eeprom::use_serial</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda766bf8fb28072e760bd2dfdcbb2cc102" compoundref="ftdi_8h" startline="266">USE_SERIAL</references>
        <references refid="structftdi__eeprom_1a54772c4686e082384adee26eeaa68005" compoundref="ftdi__i_8h" startline="63">ftdi_eeprom::use_usb_version</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda2a153af6487afaffc04f13785c99ba66" compoundref="ftdi_8h" startline="268">USE_USB_VERSION</references>
        <references refid="structftdi__eeprom_1af591e992b9bd12a484ea9d4d36e92251" compoundref="ftdi__i_8h" startline="33">ftdi_eeprom::vendor_id</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda9fe07086ac9a218e8214ba9e7a5f7933" compoundref="ftdi_8h" startline="257">VENDOR_ID</references>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga8e120f60f65859c1976c2dba99e9d002" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_set_eeprom_value</definition>
        <argsstring>(struct ftdi_context *ftdi, enum ftdi_eeprom_value value_name, int value)</argsstring>
        <name>ftdi_set_eeprom_value</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>enum <ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cd" kindref="member">ftdi_eeprom_value</ref></type>
          <declname>value_name</declname>
        </param>
        <param>
          <type>int</type>
          <declname>value</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Set a value in the decoded EEPROM Structure No parameter checking is performed</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>value_name</parametername>
</parameternamelist>
<parameterdescription>
<para>Enum of the value to set </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>value</parametername>
</parameternamelist>
<parameterdescription>
<para>to set</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Value doesn&apos;t exist </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Value not user settable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="3598" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="3597" bodyend="3769"/>
        <references refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" compoundref="ftdi__i_8h" startline="92">ftdi_eeprom::cbus_function</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdadec48df2aacb6daa4523f4fc6e09032b" compoundref="ftdi_8h" startline="274">CBUS_FUNCTION_0</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda7dd4d452169ab40e99c849f1b4ed4110" compoundref="ftdi_8h" startline="275">CBUS_FUNCTION_1</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda307435ed7db2708581a0e86eb180200c" compoundref="ftdi_8h" startline="276">CBUS_FUNCTION_2</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdabe2751f6a199a5686b80da1eda17d871" compoundref="ftdi_8h" startline="277">CBUS_FUNCTION_3</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda5e97bbd3da3aa1aa171bf33a7a9307d1" compoundref="ftdi_8h" startline="278">CBUS_FUNCTION_4</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdad39c5f41d1d70a9296ae14b3e8681c53" compoundref="ftdi_8h" startline="279">CBUS_FUNCTION_5</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda0785c792f5ea33548404dfc19e39176b" compoundref="ftdi_8h" startline="280">CBUS_FUNCTION_6</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdac4b158896f5efa2e5f1afef2532f2adf" compoundref="ftdi_8h" startline="281">CBUS_FUNCTION_7</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1d27121cb964655a42a066a188c690d2" compoundref="ftdi_8h" startline="282">CBUS_FUNCTION_8</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda0848e6d92df2404a9c1c9010ebba972d" compoundref="ftdi_8h" startline="283">CBUS_FUNCTION_9</references>
        <references refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" compoundref="ftdi__i_8h" startline="80">ftdi_eeprom::channel_a_driver</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda9764d3fb2ce5d3eff6f743dd8cfe1395" compoundref="ftdi_8h" startline="272">CHANNEL_A_DRIVER</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaee98eeb2d224f9b2c7dffc9951766ddf" compoundref="ftdi_8h" startline="308">CHANNEL_A_RS485</references>
        <references refid="structftdi__eeprom_1ac26b22453035924c2149689b07f8fae8" compoundref="ftdi__i_8h" startline="85">ftdi_eeprom::channel_a_rs485enable</references>
        <references refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" compoundref="ftdi__i_8h" startline="77">ftdi_eeprom::channel_a_type</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda86c1629835d45789c2bf3a7ee2fa7164" compoundref="ftdi_8h" startline="270">CHANNEL_A_TYPE</references>
        <references refid="structftdi__eeprom_1a128def5dc4387fdcdaddaa7c9f460637" compoundref="ftdi__i_8h" startline="81">ftdi_eeprom::channel_b_driver</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda277bd50fdc3904c70fb6851850469f21" compoundref="ftdi_8h" startline="273">CHANNEL_B_DRIVER</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda0193b368cbac2a9e7212d036532970f8" compoundref="ftdi_8h" startline="309">CHANNEL_B_RS485</references>
        <references refid="structftdi__eeprom_1aec61d454c0f8bc1c810aa5682e9fe12a" compoundref="ftdi__i_8h" startline="86">ftdi_eeprom::channel_b_rs485enable</references>
        <references refid="structftdi__eeprom_1a2da524307ba5904880ba6e2456adc4c1" compoundref="ftdi__i_8h" startline="78">ftdi_eeprom::channel_b_type</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda7ca539644f82b44fc59004dec38d3f43" compoundref="ftdi_8h" startline="271">CHANNEL_B_TYPE</references>
        <references refid="structftdi__eeprom_1ae08edaf6d0e878a3f9e08e428ac1612d" compoundref="ftdi__i_8h" startline="82">ftdi_eeprom::channel_c_driver</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda433b65c4524f72ee39083345b0f15a93" compoundref="ftdi_8h" startline="306">CHANNEL_C_DRIVER</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda2c2c59d298e324f9134e0e0aa7a2b6d2" compoundref="ftdi_8h" startline="310">CHANNEL_C_RS485</references>
        <references refid="structftdi__eeprom_1a2c8f96a24402a0f8b8a4e9b34f137142" compoundref="ftdi__i_8h" startline="87">ftdi_eeprom::channel_c_rs485enable</references>
        <references refid="structftdi__eeprom_1aea0a7b1821735930d82f24f5f0b6a006" compoundref="ftdi__i_8h" startline="83">ftdi_eeprom::channel_d_driver</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1f94c84fbd97ca5aceceff5303914219" compoundref="ftdi_8h" startline="307">CHANNEL_D_DRIVER</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda7c62d86e2e2dbb3cb0d05ac67eed71e0" compoundref="ftdi_8h" startline="311">CHANNEL_D_RS485</references>
        <references refid="structftdi__eeprom_1a6b073acb642e6053c74ec2238942adb4" compoundref="ftdi__i_8h" startline="88">ftdi_eeprom::channel_d_rs485enable</references>
        <references refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" compoundref="ftdi__i_8h" startline="130">ftdi_eeprom::chip</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda381285b7c4454a1f04d43887b55a76b9" compoundref="ftdi_8h" startline="300">CHIP_SIZE</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdab3160717262b754c6d4895cd9a3daf2e" compoundref="ftdi_8h" startline="301">CHIP_TYPE</references>
        <references refid="structftdi__eeprom_1a55c072e8789a611a3842296ca1ac5171" compoundref="ftdi__i_8h" startline="122">ftdi_eeprom::clock_polarity</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda54b3c39afc0140c234654d1738f0f18c" compoundref="ftdi_8h" startline="303">CLOCK_POLARITY</references>
        <references refid="structftdi__eeprom_1a8a1f5de674bbd131e42e924ead65c617" compoundref="ftdi__i_8h" startline="123">ftdi_eeprom::data_order</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1ecdc817b75811273206a5dededf4ddb" compoundref="ftdi_8h" startline="304">DATA_ORDER</references>
        <references refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" compoundref="ftdi_8h" startline="243">ftdi_context::eeprom</references>
        <references refid="structftdi__eeprom_1a85d03dc6aa088d929eea3c7b6b7c5741" compoundref="ftdi__i_8h" startline="124">ftdi_eeprom::flow_control</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1bc9ce65b7a27fdf832b69aef487b6b1" compoundref="ftdi_8h" startline="305">FLOW_CONTROL</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" compoundref="ftdi__i_8h" startline="107">ftdi_eeprom::group0_drive</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdae603ca8f2ed0811de45a9822fe10e405" compoundref="ftdi_8h" startline="288">GROUP0_DRIVE</references>
        <references refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" compoundref="ftdi__i_8h" startline="108">ftdi_eeprom::group0_schmitt</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaaabac9a535a103060a0b2a972985b2ec" compoundref="ftdi_8h" startline="289">GROUP0_SCHMITT</references>
        <references refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" compoundref="ftdi__i_8h" startline="109">ftdi_eeprom::group0_slew</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda5e99a23ccf517c4846f1ccbf99539009" compoundref="ftdi_8h" startline="290">GROUP0_SLEW</references>
        <references refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" compoundref="ftdi__i_8h" startline="110">ftdi_eeprom::group1_drive</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaf4659c175213672ec8390fef0e846822" compoundref="ftdi_8h" startline="291">GROUP1_DRIVE</references>
        <references refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" compoundref="ftdi__i_8h" startline="111">ftdi_eeprom::group1_schmitt</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda01c1da99b72ec3e60ac6800f5baaf469" compoundref="ftdi_8h" startline="292">GROUP1_SCHMITT</references>
        <references refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" compoundref="ftdi__i_8h" startline="112">ftdi_eeprom::group1_slew</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda8ceab8fc99a4e1ff94c31cf6c8f88028" compoundref="ftdi_8h" startline="293">GROUP1_SLEW</references>
        <references refid="structftdi__eeprom_1a58cb0545a65f6f0bf431e186f1b44f71" compoundref="ftdi__i_8h" startline="113">ftdi_eeprom::group2_drive</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda02006a9fb9f6b3272e60382266f27e6f" compoundref="ftdi_8h" startline="294">GROUP2_DRIVE</references>
        <references refid="structftdi__eeprom_1aa6c5c7b16e649d70e358b021ad0c469e" compoundref="ftdi__i_8h" startline="114">ftdi_eeprom::group2_schmitt</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda18987baccc2899292d93b35d953905f1" compoundref="ftdi_8h" startline="295">GROUP2_SCHMITT</references>
        <references refid="structftdi__eeprom_1ab69800fef64ca3d55449eab4322e5090" compoundref="ftdi__i_8h" startline="115">ftdi_eeprom::group2_slew</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdabbb8cd7178ae1d655a205c8197f5bbdd" compoundref="ftdi_8h" startline="296">GROUP2_SLEW</references>
        <references refid="structftdi__eeprom_1ae5c54d334e18338296557572deee7433" compoundref="ftdi__i_8h" startline="116">ftdi_eeprom::group3_drive</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda954be78df39d339bc94729789f81a03e" compoundref="ftdi_8h" startline="297">GROUP3_DRIVE</references>
        <references refid="structftdi__eeprom_1a7afc69623874f8b64614f2688f08033e" compoundref="ftdi__i_8h" startline="117">ftdi_eeprom::group3_schmitt</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaff4e78fe8f024261c763dc3e3dccc717" compoundref="ftdi_8h" startline="298">GROUP3_SCHMITT</references>
        <references refid="structftdi__eeprom_1a13e5b314e0a2c1e0a67f6bb31ac07f5a" compoundref="ftdi__i_8h" startline="118">ftdi_eeprom::group3_slew</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdae7befb90d908e4035c69dfe8e783e29a" compoundref="ftdi_8h" startline="299">GROUP3_SLEW</references>
        <references refid="structftdi__eeprom_1ad377261e985c768c2ca5731e9690efd9" compoundref="ftdi__i_8h" startline="94">ftdi_eeprom::high_current</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda70b51ab39f14a27a35a89e07bd6807aa" compoundref="ftdi_8h" startline="284">HIGH_CURRENT</references>
        <references refid="structftdi__eeprom_1a4bf7b50ec4259aa83623bc9ed789c429" compoundref="ftdi__i_8h" startline="96">ftdi_eeprom::high_current_a</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda8ec56c968baf80eae5239dba2616868f" compoundref="ftdi_8h" startline="285">HIGH_CURRENT_A</references>
        <references refid="structftdi__eeprom_1a5016f08e6af06307abe71c15165d24ab" compoundref="ftdi__i_8h" startline="98">ftdi_eeprom::high_current_b</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda99f59a21df7285884ce88738d1e97187" compoundref="ftdi_8h" startline="286">HIGH_CURRENT_B</references>
        <references refid="structftdi__eeprom_1a5117b50c00668aff73b5df385b0fc5f8" compoundref="ftdi__i_8h" startline="52">ftdi_eeprom::in_is_isochronous</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda14520ed9a009b332096746b8b014ba84" compoundref="ftdi_8h" startline="263">IN_IS_ISOCHRONOUS</references>
        <references refid="structftdi__eeprom_1a4876d3d01242d7c3b2961b1a42b35509" compoundref="ftdi__i_8h" startline="100">ftdi_eeprom::invert</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdab5f95af56a0f14f0032750594b523c95" compoundref="ftdi_8h" startline="287">INVERT</references>
        <references refid="structftdi__eeprom_1a30dad8c71143befc6f947bcf04e63aa2" compoundref="ftdi__i_8h" startline="46">ftdi_eeprom::is_not_pnp</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda80005060e30959d4d90449f343a0b777" compoundref="ftdi_8h" startline="261">IS_NOT_PNP</references>
        <references refid="structftdi__eeprom_1a8aa39af43a6ac5c05b8682d8b3904e3c" compoundref="ftdi__i_8h" startline="65">ftdi_eeprom::max_power</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda83623d0e379659fb8113d8c5f6394706" compoundref="ftdi_8h" startline="269">MAX_POWER</references>
        <references refid="structftdi__eeprom_1ab9885ee665c318a8d19c28a9c75b999a" compoundref="ftdi__i_8h" startline="54">ftdi_eeprom::out_is_isochronous</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdac3d4167972b6222c4035a259fca7126d" compoundref="ftdi_8h" startline="264">OUT_IS_ISOCHRONOUS</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda412ffca781db3a099f287df487667d19" compoundref="ftdi_8h" startline="302">POWER_SAVE</references>
        <references refid="structftdi__eeprom_1acbaa0dac427977d4f8fcd735a34bf2c3" compoundref="ftdi__i_8h" startline="120">ftdi_eeprom::powersave</references>
        <references refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" compoundref="ftdi__i_8h" startline="35">ftdi_eeprom::product_id</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda6c2d445571c53a6ffaa9ad9e84258e6b" compoundref="ftdi_8h" startline="258">PRODUCT_ID</references>
        <references refid="structftdi__eeprom_1a9b82f88497b432bebfa4dd92c304cb02" compoundref="ftdi__i_8h" startline="44">ftdi_eeprom::remote_wakeup</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda65603b0b33ba5a1cf2fc9abbabf731eb" compoundref="ftdi_8h" startline="260">REMOTE_WAKEUP</references>
        <references refid="structftdi__eeprom_1a055d6bef2328557e6ac4d2909e42d21b" compoundref="ftdi__i_8h" startline="42">ftdi_eeprom::self_powered</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda8921cc2e575c669f3b6116ec6c2946a4" compoundref="ftdi_8h" startline="259">SELF_POWERED</references>
        <references refid="structftdi__eeprom_1afc46f39449462d10f9b8992523214136" compoundref="ftdi__i_8h" startline="49">ftdi_eeprom::suspend_dbus7</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda17887eedccc85d83d1ce847be1e433ed" compoundref="ftdi_8h" startline="262">SUSPEND_DBUS7</references>
        <references refid="structftdi__eeprom_1a722a630d370318cefa94de1365f98786" compoundref="ftdi__i_8h" startline="56">ftdi_eeprom::suspend_pull_downs</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda68d4ae93864ec70b19d9cf511d8f05ec" compoundref="ftdi_8h" startline="265">SUSPEND_PULL_DOWNS</references>
        <references refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" compoundref="ftdi__i_8h" startline="61">ftdi_eeprom::usb_version</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda54e6e162c0578b9576d31c069d43f3da" compoundref="ftdi_8h" startline="267">USB_VERSION</references>
        <references refid="structftdi__eeprom_1abe250275595d020fd8de3aa61d093d38" compoundref="ftdi__i_8h" startline="59">ftdi_eeprom::use_serial</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda766bf8fb28072e760bd2dfdcbb2cc102" compoundref="ftdi_8h" startline="266">USE_SERIAL</references>
        <references refid="structftdi__eeprom_1a54772c4686e082384adee26eeaa68005" compoundref="ftdi__i_8h" startline="63">ftdi_eeprom::use_usb_version</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda2a153af6487afaffc04f13785c99ba66" compoundref="ftdi_8h" startline="268">USE_USB_VERSION</references>
        <references refid="structftdi__eeprom_1af591e992b9bd12a484ea9d4d36e92251" compoundref="ftdi__i_8h" startline="33">ftdi_eeprom::vendor_id</references>
        <references refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda9fe07086ac9a218e8214ba9e7a5f7933" compoundref="ftdi_8h" startline="257">VENDOR_ID</references>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga92a449af4a1becc70e80e49f3c937bbd" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_get_eeprom_buf</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned char *buf, int size)</argsstring>
        <name>ftdi_get_eeprom_buf</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned char *</type>
          <declname>buf</declname>
        </param>
        <param>
          <type>int</type>
          <declname>size</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Get the read-only buffer to the binary EEPROM content</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>buf</parametername>
</parameternamelist>
<parameterdescription>
<para>buffer to receive EEPROM content </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>size</parametername>
</parameternamelist>
<parameterdescription>
<para>Size of receiving buffer</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>All fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>struct ftdi_contxt or <ref refid="structftdi__eeprom" kindref="compound">ftdi_eeprom</ref> missing </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Not enough room to store eeprom </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="3782" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="3781" bodyend="3796"/>
        <references refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" compoundref="ftdi__i_8h" startline="131">ftdi_eeprom::buf</references>
        <references refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" compoundref="ftdi_8h" startline="243">ftdi_context::eeprom</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="ftdi__i_8h_1a0c61fd6cfc8b3ec904d270a7980e8f37" compoundref="ftdi__i_8h" startline="22">FTDI_MAX_EEPROM_SIZE</references>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gaad29bea74f6ae02ed757d2a39c060969" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_set_eeprom_buf</definition>
        <argsstring>(struct ftdi_context *ftdi, const unsigned char *buf, int size)</argsstring>
        <name>ftdi_set_eeprom_buf</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>const unsigned char *</type>
          <declname>buf</declname>
        </param>
        <param>
          <type>int</type>
          <declname>size</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Set the EEPROM content from the user-supplied prefilled buffer</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>buf</parametername>
</parameternamelist>
<parameterdescription>
<para>buffer to read EEPROM content </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>size</parametername>
</parameternamelist>
<parameterdescription>
<para>Size of buffer</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>All fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>struct ftdi_contxt or <ref refid="structftdi__eeprom" kindref="compound">ftdi_eeprom</ref> of buf missing </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="3808" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="3807" bodyend="3819"/>
        <references refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" compoundref="ftdi__i_8h" startline="131">ftdi_eeprom::buf</references>
        <references refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" compoundref="ftdi_8h" startline="243">ftdi_context::eeprom</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="ftdi__i_8h_1a0c61fd6cfc8b3ec904d270a7980e8f37" compoundref="ftdi__i_8h" startline="22">FTDI_MAX_EEPROM_SIZE</references>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga650df1dc49ec78f0ee58b1c4f2644fd9" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_read_eeprom_location</definition>
        <argsstring>(struct ftdi_context *ftdi, int eeprom_addr, unsigned short *eeprom_val)</argsstring>
        <name>ftdi_read_eeprom_location</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>int</type>
          <declname>eeprom_addr</declname>
        </param>
        <param>
          <type>unsigned short *</type>
          <declname>eeprom_val</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Read eeprom location</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>eeprom_addr</parametername>
</parameternamelist>
<parameterdescription>
<para>Address of eeprom location to be read </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>eeprom_val</parametername>
</parameternamelist>
<parameterdescription>
<para>Pointer to store read eeprom location</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>read failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="3833" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="3832" bodyend="3841"/>
        <references refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" compoundref="ftdi_8h" startline="131">FTDI_DEVICE_IN_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="ftdi_8h_1a9942db0e999f3b8549488d2346b55ad5" compoundref="ftdi_8h" startline="146">SIO_READ_EEPROM_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" compoundref="ftdi_8h" startline="205">ftdi_context::usb_read_timeout</references>
        <referencedby refid="group__libftdi_1ga25eb9a83a925065b6c3b61b8f0565951" compoundref="ftdi_8c" startline="4055" endline="4108">ftdi_erase_eeprom</referencedby>
        <referencedby refid="group__libftdi_1ga5f2f678fc05cb8f92708fb1e5eb75100" compoundref="ftdi_8c" startline="3949" endline="3993">ftdi_write_eeprom_location</referencedby>
        <referencedby refid="classFtdi_1_1Eeprom_1aacdb0d74cceaeae77b754232c8b68f9e" compoundref="ftdi_8cpp" startline="424" endline="427">Ftdi::Eeprom::read_location</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gac157786fdf2e9c6b51dd9b4ddbb34d5f" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_read_eeprom</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_read_eeprom</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Read eeprom</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>read failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="3853" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="3852" bodyend="3882"/>
        <references refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" compoundref="ftdi__i_8h" startline="131">ftdi_eeprom::buf</references>
        <references refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" compoundref="ftdi_8h" startline="243">ftdi_context::eeprom</references>
        <references refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" compoundref="ftdi_8h" startline="131">FTDI_DEVICE_IN_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="ftdi__i_8h_1a0c61fd6cfc8b3ec904d270a7980e8f37" compoundref="ftdi__i_8h" startline="22">FTDI_MAX_EEPROM_SIZE</references>
        <references refid="ftdi_8h_1a9942db0e999f3b8549488d2346b55ad5" compoundref="ftdi_8h" startline="146">SIO_READ_EEPROM_REQUEST</references>
        <references refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" compoundref="ftdi__i_8h" startline="128">ftdi_eeprom::size</references>
        <references refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" compoundref="ftdi_8h" startline="211">ftdi_context::type</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" compoundref="ftdi_8h" startline="24">TYPE_R</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" compoundref="ftdi_8h" startline="205">ftdi_context::usb_read_timeout</references>
        <referencedby refid="classFtdi_1_1Eeprom_1a59ef82e22828370274fa7de627eff2e4" compoundref="ftdi_8cpp" startline="414" endline="417">Ftdi::Eeprom::read</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga7b52565de864db82624b070c91e0cb67" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>unsigned char</type>
        <definition>static unsigned char ftdi_read_chipid_shift</definition>
        <argsstring>(unsigned char value)</argsstring>
        <name>ftdi_read_chipid_shift</name>
        <param>
          <type>unsigned char</type>
          <declname>value</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="3890" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="3889" bodyend="3899"/>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1gab978a76c2cc0dbfbc1fd6350db848300" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_read_chipid</definition>
        <argsstring>(struct ftdi_context *ftdi, unsigned int *chipid)</argsstring>
        <name>ftdi_read_chipid</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>unsigned int *</type>
          <declname>chipid</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Read the FTDIChip-ID from R-type devices</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>chipid</parametername>
</parameternamelist>
<parameterdescription>
<para>Pointer to store FTDIChip-ID</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>read failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="3912" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="3911" bodyend="3933"/>
        <references refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" compoundref="ftdi_8h" startline="131">FTDI_DEVICE_IN_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="ftdi_8h_1a9942db0e999f3b8549488d2346b55ad5" compoundref="ftdi_8h" startline="146">SIO_READ_EEPROM_REQUEST</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" compoundref="ftdi_8h" startline="205">ftdi_context::usb_read_timeout</references>
        <referencedby refid="classFtdi_1_1Eeprom_1af7ab5af427de9c7464f11f1ec784c4da" compoundref="ftdi_8cpp" startline="404" endline="407">Ftdi::Eeprom::chip_id</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga5f2f678fc05cb8f92708fb1e5eb75100" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_write_eeprom_location</definition>
        <argsstring>(struct ftdi_context *ftdi, int eeprom_addr, unsigned short eeprom_val)</argsstring>
        <name>ftdi_write_eeprom_location</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <param>
          <type>int</type>
          <declname>eeprom_addr</declname>
        </param>
        <param>
          <type>unsigned short</type>
          <declname>eeprom_val</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Write eeprom location</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>eeprom_addr</parametername>
</parameternamelist>
<parameterdescription>
<para>Address of eeprom location to be written </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>eeprom_val</parametername>
</parameternamelist>
<parameterdescription>
<para>Value to be written</para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>write failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Invalid access to checksum protected area below 0x80 </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-4</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Device can&apos;t access unprotected area </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-5</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>Reading chip type failed </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="3951" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="3949" bodyend="3993"/>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="group__libftdi_1ga650df1dc49ec78f0ee58b1c4f2644fd9" compoundref="ftdi_8c" startline="3832" endline="3841">ftdi_read_eeprom_location</references>
        <references refid="ftdi_8h_1aaea5180ed6c97e8ab5c3d50c16b04076" compoundref="ftdi_8h" startline="147">SIO_WRITE_EEPROM_REQUEST</references>
        <references refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" compoundref="ftdi_8h" startline="211">ftdi_context::type</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" compoundref="ftdi_8h" startline="24">TYPE_2232C</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" compoundref="ftdi_8h" startline="24">TYPE_2232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" compoundref="ftdi_8h" startline="24">TYPE_232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" compoundref="ftdi_8h" startline="24">TYPE_4232H</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" compoundref="ftdi_8h" startline="24">TYPE_BM</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="classFtdi_1_1Eeprom_1aaa79973c9fa5c44e041ad416860fa1b8" compoundref="ftdi_8cpp" startline="429" endline="432">Ftdi::Eeprom::write_location</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga8cc9811660d1adfb4b30157c5ab26d5a" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_write_eeprom</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_write_eeprom</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Write eeprom</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>0</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>all fine </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-1</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>read failed </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-2</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>USB device unavailable </para></parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>-3</parametername>
<parametername>:</parametername>
</parameternamelist>
<parameterdescription>
<para>EEPROM not initialized for the connected device; </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="4006" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="4005" bodyend="4038"/>
        <references refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" compoundref="ftdi__i_8h" startline="131">ftdi_eeprom::buf</references>
        <references refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" compoundref="ftdi_8h" startline="243">ftdi_context::eeprom</references>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="group__libftdi_1ga396c3bf1435fb3317755868e28c47414" compoundref="ftdi_8c" startline="2087" endline="2100">ftdi_poll_modem_status</references>
        <references refid="group__libftdi_1ga3e0227b0c7aa859d2d2afb5ffa4c8466" compoundref="ftdi_8c" startline="2006" endline="2021">ftdi_set_latency_timer</references>
        <references refid="group__libftdi_1ga266ccc351ea31289022063a8ae29edf4" compoundref="ftdi_8c" startline="880" endline="895">ftdi_usb_reset</references>
        <references refid="structftdi__eeprom_1a7a44fb7a64c3114f33561aa6214e5182" compoundref="ftdi__i_8h" startline="39">ftdi_eeprom::initialized_for_connected_device</references>
        <references refid="ftdi_8h_1aaea5180ed6c97e8ab5c3d50c16b04076" compoundref="ftdi_8h" startline="147">SIO_WRITE_EEPROM_REQUEST</references>
        <references refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" compoundref="ftdi__i_8h" startline="128">ftdi_eeprom::size</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="classFtdi_1_1Eeprom_1ac6fb73bd70749209c46bdd9529344392" compoundref="ftdi_8cpp" startline="419" endline="422">Ftdi::Eeprom::write</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga25eb9a83a925065b6c3b61b8f0565951" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ftdi_erase_eeprom</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_erase_eeprom</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="4056" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="4055" bodyend="4108"/>
        <references refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" compoundref="ftdi__i_8h" startline="130">ftdi_eeprom::chip</references>
        <references refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" compoundref="ftdi_8h" startline="243">ftdi_context::eeprom</references>
        <references refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" compoundref="ftdi_8h" startline="130">FTDI_DEVICE_OUT_REQTYPE</references>
        <references refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" compoundref="ftdi_8c" startline="41">ftdi_error_return</references>
        <references refid="group__libftdi_1ga650df1dc49ec78f0ee58b1c4f2644fd9" compoundref="ftdi_8c" startline="3832" endline="3841">ftdi_read_eeprom_location</references>
        <references refid="group__libftdi_1ga94630370ae389fb1189282fa0742f310" compoundref="ftdi_8c" startline="4054">MAGIC</references>
        <references refid="ftdi_8h_1a8150b0280c2dff228abba700c4cec491" compoundref="ftdi_8h" startline="148">SIO_ERASE_EEPROM_REQUEST</references>
        <references refid="ftdi_8h_1aaea5180ed6c97e8ab5c3d50c16b04076" compoundref="ftdi_8h" startline="147">SIO_WRITE_EEPROM_REQUEST</references>
        <references refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" compoundref="ftdi_8h" startline="211">ftdi_context::type</references>
        <references refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" compoundref="ftdi_8h" startline="24">TYPE_R</references>
        <references refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" compoundref="ftdi_8h" startline="203">ftdi_context::usb_dev</references>
        <references refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" compoundref="ftdi_8h" startline="207">ftdi_context::usb_write_timeout</references>
        <referencedby refid="classFtdi_1_1Eeprom_1a3044b5cd481ebbefd3c64e4653e8d6f3" compoundref="ftdi_8cpp" startline="434" endline="437">Ftdi::Eeprom::erase</referencedby>
      </memberdef>
      <memberdef kind="function" id="group__libftdi_1ga28c84d963760d7396e5a2992e63a9354" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>char *</type>
        <definition>char* ftdi_get_error_string</definition>
        <argsstring>(struct ftdi_context *ftdi)</argsstring>
        <name>ftdi_get_error_string</name>
        <param>
          <type>struct <ref refid="structftdi__context" kindref="compound">ftdi_context</ref> *</type>
          <declname>ftdi</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Get string representation for last error code</para><para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>ftdi</parametername>
</parameternamelist>
<parameterdescription>
<para>pointer to <ref refid="structftdi__context" kindref="compound">ftdi_context</ref></para></parameterdescription>
</parameteritem>
</parameterlist>
<parameterlist kind="retval"><parameteritem>
<parameternamelist>
<parametername>Pointer</parametername>
</parameternamelist>
<parameterdescription>
<para>to error string </para></parameterdescription>
</parameteritem>
</parameterlist>
</para>        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" line="4118" bodyfile="C:/work/libftdi/libftdi1-1.0/src/ftdi.c" bodystart="4117" bodyend="4123"/>
        <references refid="structftdi__context_1accc4dc90cea120d545faf82c6034d445" compoundref="ftdi_8h" startline="246">ftdi_context::error_str</references>
        <referencedby refid="classFtdi_1_1Context_1ab4e06e0e4bf156c0c5421ec0bbb4cdd1" compoundref="ftdi_8cpp" startline="297" endline="300">Ftdi::Context::error_string</referencedby>
        <referencedby refid="ftdi__stream_8c_1abffdbbc8e303b2e4e85551734682a0b4" compoundref="ftdi__stream_8c" startline="147" endline="295">ftdi_readstream</referencedby>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/***************************************************************************</highlight></codeline>
<codeline lineno="2"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi.c<sp/><sp/>-<sp/><sp/>description</highlight></codeline>
<codeline lineno="3"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>-------------------</highlight></codeline>
<codeline lineno="4"><highlight class="comment"><sp/><sp/><sp/><sp/>begin<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>:<sp/>Fri<sp/>Apr<sp/>4<sp/>2003</highlight></codeline>
<codeline lineno="5"><highlight class="comment"><sp/><sp/><sp/><sp/>copyright<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>:<sp/>(C)<sp/>2003-2013<sp/>by<sp/>Intra2net<sp/>AG<sp/>and<sp/>the<sp/>libftdi<sp/>developers</highlight></codeline>
<codeline lineno="6"><highlight class="comment"><sp/><sp/><sp/><sp/>email<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>:<sp/>opensource@intra2net.com</highlight></codeline>
<codeline lineno="7"><highlight class="comment"><sp/>***************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="8"><highlight class="normal"></highlight></codeline>
<codeline lineno="9"><highlight class="normal"></highlight><highlight class="comment">/***************************************************************************</highlight></codeline>
<codeline lineno="10"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*</highlight></codeline>
<codeline lineno="11"><highlight class="comment"><sp/>*<sp/><sp/><sp/>This<sp/>program<sp/>is<sp/>free<sp/>software;<sp/>you<sp/>can<sp/>redistribute<sp/>it<sp/>and/or<sp/>modify<sp/><sp/>*</highlight></codeline>
<codeline lineno="12"><highlight class="comment"><sp/>*<sp/><sp/><sp/>it<sp/>under<sp/>the<sp/>terms<sp/>of<sp/>the<sp/>GNU<sp/>Lesser<sp/>General<sp/>Public<sp/>License<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*</highlight></codeline>
<codeline lineno="13"><highlight class="comment"><sp/>*<sp/><sp/><sp/>version<sp/>2.1<sp/>as<sp/>published<sp/>by<sp/>the<sp/>Free<sp/>Software<sp/>Foundation;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*</highlight></codeline>
<codeline lineno="14"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*</highlight></codeline>
<codeline lineno="15"><highlight class="comment"><sp/>***************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight></codeline>
<codeline lineno="29"><highlight class="comment">/*<sp/>@{<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;libusb.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;string.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;errno.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;stdio.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;stdlib.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight></codeline>
<codeline lineno="37"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="ftdi__i_8h" kindref="compound">ftdi_i.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="38"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="ftdi_8h" kindref="compound">ftdi.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;ftdi_version_i.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight></codeline>
<codeline lineno="41" refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" refkind="member"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>ftdi_error_return(code,<sp/>str)<sp/>do<sp/>{<sp/><sp/>\</highlight></codeline>
<codeline lineno="42"><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(<sp/>ftdi<sp/>)<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\</highlight></codeline>
<codeline lineno="43"><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;error_str<sp/>=<sp/>str;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\</highlight></codeline>
<codeline lineno="44"><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>else<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\</highlight></codeline>
<codeline lineno="45"><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stderr,<sp/>str);<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\</highlight></codeline>
<codeline lineno="46"><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>return<sp/>code;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\</highlight></codeline>
<codeline lineno="47"><highlight class="preprocessor"><sp/><sp/><sp/>}<sp/>while(0);</highlight></codeline>
<codeline lineno="48"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="49" refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" refkind="member"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>ftdi_error_return_free_device_list(code,<sp/>str,<sp/>devs)<sp/>do<sp/>{<sp/><sp/><sp/><sp/>\</highlight></codeline>
<codeline lineno="50"><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_free_device_list(devs,1);<sp/><sp/><sp/>\</highlight></codeline>
<codeline lineno="51"><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;error_str<sp/>=<sp/>str;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\</highlight></codeline>
<codeline lineno="52"><highlight class="preprocessor"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>return<sp/>code;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>\</highlight></codeline>
<codeline lineno="53"><highlight class="preprocessor"><sp/><sp/><sp/>}<sp/>while(0);</highlight></codeline>
<codeline lineno="54"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight></codeline>
<codeline lineno="65"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>ftdi_usb_close_internal<sp/>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="66"><highlight class="normal">{</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>&amp;&amp;<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>)</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_close<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>);</highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>)</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a7a44fb7a64c3114f33561aa6214e5182" kindref="member">initialized_for_connected_device</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="74"><highlight class="normal">}</highlight></codeline>
<codeline lineno="75"><highlight class="normal"></highlight></codeline>
<codeline lineno="88" refid="group__libftdi_1ga21e2ed53cad4fa8242022afe1e12d2ee" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga21e2ed53cad4fa8242022afe1e12d2ee" kindref="member">ftdi_init</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="89"><highlight class="normal">{</highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__eeprom" kindref="compound" tooltip="FTDI eeprom structure.">ftdi_eeprom</ref>*<sp/>eeprom<sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__eeprom" kindref="compound" tooltip="FTDI eeprom structure.">ftdi_eeprom</ref><sp/>*)malloc(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__eeprom" kindref="compound" tooltip="FTDI eeprom structure.">ftdi_eeprom</ref>));</highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" kindref="member">usb_ctx</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" kindref="member">usb_read_timeout</ref><sp/>=<sp/>5000;</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref><sp/>=<sp/>5000;</highlight></codeline>
<codeline lineno="95"><highlight class="normal"></highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>;<sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>chip<sp/>type<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aa688eb2312af3a9fb6b56a8c59178e34" kindref="member">baudrate</ref><sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a164c17ee7bddaa0d76da8da7138f602f" kindref="member">bitbang_enabled</ref><sp/>=<sp/>0;<sp/><sp/></highlight><highlight class="comment">/*<sp/>0:<sp/>normal<sp/>mode<sp/>1:<sp/>any<sp/>of<sp/>the<sp/>bitbang<sp/>modes<sp/>enabled<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="99"><highlight class="normal"></highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a127d66a8b7602bd767fb01ce90e2a6be" kindref="member">writebuffer_chunksize</ref><sp/>=<sp/>4096;</highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a7ca2f7e68cd28e1c3079d029fd6129c0" kindref="member">max_packet_size</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1accc4dc90cea120d545faf82c6034d445" kindref="member">error_str</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a06072f2484298ae90fcffe450a133250" kindref="member">module_detach_mode</ref><sp/>=<sp/><ref refid="ftdi_8h_1adb5c9021fa85791df4a0b9dac671109aa3fde2d289c2051df02332045e58f4a76" kindref="member">AUTO_DETACH_SIO_MODULE</ref>;</highlight></codeline>
<codeline lineno="107"><highlight class="normal"></highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_init(&amp;ftdi-&gt;<ref refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" kindref="member">usb_ctx</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;libusb_init()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="110"><highlight class="normal"></highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga6dc886d709eced377a33dc975fa6e771" kindref="member">ftdi_set_interface</ref>(ftdi,<sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a794b6a029883152ff98ea1f6c896b02d" kindref="member">INTERFACE_ANY</ref>);</highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a017557435f4377c2353d9d3b7fbcff01" kindref="member">bitbang_mode</ref><sp/>=<sp/>1;<sp/></highlight><highlight class="comment">/*<sp/>when<sp/>bitbang<sp/>is<sp/>enabled<sp/>this<sp/>holds<sp/>the<sp/>number<sp/>of<sp/>the<sp/>mode<sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="113"><highlight class="normal"></highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom<sp/>==<sp/>0)</highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;Can&apos;t<sp/>malloc<sp/>struct<sp/>ftdi_eeprom&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/>memset(eeprom,<sp/>0,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__eeprom" kindref="compound" tooltip="FTDI eeprom structure.">ftdi_eeprom</ref>));</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref><sp/>=<sp/>eeprom;</highlight></codeline>
<codeline lineno="118"><highlight class="normal"></highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>All<sp/>fine.<sp/>Now<sp/>allocate<sp/>the<sp/>readbuffer<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga65783703baf0828d519ef597bb2855c1" kindref="member">ftdi_read_data_set_chunksize</ref>(ftdi,<sp/>4096);</highlight></codeline>
<codeline lineno="121"><highlight class="normal">}</highlight></codeline>
<codeline lineno="122"><highlight class="normal"></highlight></codeline>
<codeline lineno="128" refid="group__libftdi_1gafd46c6784367fd95c5f852d3b38949a8" refkind="member"><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*<ref refid="group__libftdi_1gafd46c6784367fd95c5f852d3b38949a8" kindref="member">ftdi_new</ref>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="129"><highlight class="normal">{</highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*<sp/>ftdi<sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*)malloc(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref>));</highlight></codeline>
<codeline lineno="131"><highlight class="normal"></highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>NULL;</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="136"><highlight class="normal"></highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="group__libftdi_1ga21e2ed53cad4fa8242022afe1e12d2ee" kindref="member">ftdi_init</ref>(ftdi)<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(ftdi);</highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>NULL;</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="142"><highlight class="normal"></highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ftdi;</highlight></codeline>
<codeline lineno="144"><highlight class="normal">}</highlight></codeline>
<codeline lineno="145"><highlight class="normal"></highlight></codeline>
<codeline lineno="157" refid="group__libftdi_1ga6dc886d709eced377a33dc975fa6e771" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga6dc886d709eced377a33dc975fa6e771" kindref="member">ftdi_set_interface</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265" kindref="member">ftdi_interface</ref><sp/><ref refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" kindref="member">interface</ref>)</highlight></codeline>
<codeline lineno="158"><highlight class="normal">{</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="161"><highlight class="normal"></highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>check_interface<sp/>=<sp/><ref refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" kindref="member">interface</ref>;</highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(check_interface<sp/>==<sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a794b6a029883152ff98ea1f6c896b02d" kindref="member">INTERFACE_ANY</ref>)</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>check_interface<sp/>=<sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265afb60d9e73330c16ba970b3dd169fe4d1" kindref="member">INTERFACE_A</ref>;</highlight></codeline>
<codeline lineno="167"><highlight class="normal"></highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref><sp/>!=<sp/>check_interface)</highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;Interface<sp/>can<sp/>not<sp/>be<sp/>changed<sp/>on<sp/>an<sp/>already<sp/>open<sp/>device&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="171"><highlight class="normal"></highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(interface)</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a794b6a029883152ff98ea1f6c896b02d" kindref="member">INTERFACE_ANY</ref>:</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265afb60d9e73330c16ba970b3dd169fe4d1" kindref="member">INTERFACE_A</ref>:</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" kindref="member">interface</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref><sp/><sp/><sp/><sp/><sp/>=<sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265afb60d9e73330c16ba970b3dd169fe4d1" kindref="member">INTERFACE_A</ref>;</highlight></codeline>
<codeline lineno="178"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a9b6cfd3763a3ca80c76bc52c89dad968" kindref="member">in_ep</ref><sp/><sp/><sp/><sp/><sp/>=<sp/>0x02;</highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a079427d8f2c09102bcadb9118e60c0ec" kindref="member">out_ep</ref><sp/><sp/><sp/><sp/>=<sp/>0x81;</highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a5326a506445adc927025ee5c55452380" kindref="member">INTERFACE_B</ref>:</highlight></codeline>
<codeline lineno="182"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" kindref="member">interface</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="183"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref><sp/><sp/><sp/><sp/><sp/>=<sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a5326a506445adc927025ee5c55452380" kindref="member">INTERFACE_B</ref>;</highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a9b6cfd3763a3ca80c76bc52c89dad968" kindref="member">in_ep</ref><sp/><sp/><sp/><sp/><sp/>=<sp/>0x04;</highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a079427d8f2c09102bcadb9118e60c0ec" kindref="member">out_ep</ref><sp/><sp/><sp/><sp/>=<sp/>0x83;</highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a1eb34784ca745a5d76480c190a92d68c" kindref="member">INTERFACE_C</ref>:</highlight></codeline>
<codeline lineno="188"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" kindref="member">interface</ref><sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref><sp/><sp/><sp/><sp/><sp/>=<sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a1eb34784ca745a5d76480c190a92d68c" kindref="member">INTERFACE_C</ref>;</highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a9b6cfd3763a3ca80c76bc52c89dad968" kindref="member">in_ep</ref><sp/><sp/><sp/><sp/><sp/>=<sp/>0x06;</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a079427d8f2c09102bcadb9118e60c0ec" kindref="member">out_ep</ref><sp/><sp/><sp/><sp/>=<sp/>0x85;</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a3b672d2aef77ffdf9d59d827db194021" kindref="member">INTERFACE_D</ref>:</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" kindref="member">interface</ref><sp/>=<sp/>3;</highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref><sp/><sp/><sp/><sp/><sp/>=<sp/><ref refid="ftdi_8h_1a9c55e66c45a0e4ec5548ee7d6e1a9265a3b672d2aef77ffdf9d59d827db194021" kindref="member">INTERFACE_D</ref>;</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a9b6cfd3763a3ca80c76bc52c89dad968" kindref="member">in_ep</ref><sp/><sp/><sp/><sp/><sp/>=<sp/>0x08;</highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a079427d8f2c09102bcadb9118e60c0ec" kindref="member">out_ep</ref><sp/><sp/><sp/><sp/>=<sp/>0x87;</highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;Unknown<sp/>interface&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="203"><highlight class="normal">}</highlight></codeline>
<codeline lineno="204"><highlight class="normal"></highlight></codeline>
<codeline lineno="210" refid="group__libftdi_1ga72838200be98d88737d532f9eee1e7be" refkind="member"><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga72838200be98d88737d532f9eee1e7be" kindref="member">ftdi_deinit</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="211"><highlight class="normal">{</highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="214"><highlight class="normal"></highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="216"><highlight class="normal"></highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref><sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>);</highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="222"><highlight class="normal"></highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref><sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref><sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>);</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref><sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>);</highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref><sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="237"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>);</highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>);</highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="242"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="243"><highlight class="normal"></highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" kindref="member">usb_ctx</ref>)</highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_exit(ftdi-&gt;<ref refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" kindref="member">usb_ctx</ref>);</highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" kindref="member">usb_ctx</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="249"><highlight class="normal">}</highlight></codeline>
<codeline lineno="250"><highlight class="normal"></highlight></codeline>
<codeline lineno="256" refid="group__libftdi_1ga3cc28e5b7f1f50246861fcb39e7dd291" refkind="member"><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga3cc28e5b7f1f50246861fcb39e7dd291" kindref="member">ftdi_free</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="257"><highlight class="normal">{</highlight></codeline>
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga72838200be98d88737d532f9eee1e7be" kindref="member">ftdi_deinit</ref>(ftdi);</highlight></codeline>
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/>free(ftdi);</highlight></codeline>
<codeline lineno="260"><highlight class="normal">}</highlight></codeline>
<codeline lineno="261"><highlight class="normal"></highlight></codeline>
<codeline lineno="268" refid="group__libftdi_1ga1eb46e0bb208b64f88169b5452cf6e94" refkind="member"><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga1eb46e0bb208b64f88169b5452cf6e94" kindref="member">ftdi_set_usbdev</ref><sp/>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/>libusb_device_handle<sp/>*usb)</highlight></codeline>
<codeline lineno="269"><highlight class="normal">{</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="272"><highlight class="normal"></highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>=<sp/>usb;</highlight></codeline>
<codeline lineno="274"><highlight class="normal">}</highlight></codeline>
<codeline lineno="275"><highlight class="normal"></highlight></codeline>
<codeline lineno="281" refid="group__libftdi_1ga161635898138bfc1ebecda10fc999cde" refkind="member"><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__version__info" kindref="compound">ftdi_version_info</ref><sp/><ref refid="group__libftdi_1ga161635898138bfc1ebecda10fc999cde" kindref="member" tooltip="Get libftdi library version.">ftdi_get_library_version</ref>()</highlight></codeline>
<codeline lineno="282"><highlight class="normal">{</highlight></codeline>
<codeline lineno="283"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__version__info" kindref="compound">ftdi_version_info</ref><sp/>ver;</highlight></codeline>
<codeline lineno="284"><highlight class="normal"></highlight></codeline>
<codeline lineno="285"><highlight class="normal"><sp/><sp/><sp/><sp/>ver.<ref refid="structftdi__version__info_1a5644a73d7e253c663738d4e705999910" kindref="member">major</ref><sp/>=<sp/>FTDI_MAJOR_VERSION;</highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/><sp/><sp/>ver.<ref refid="structftdi__version__info_1a011b5e8cbe4af99afd0a0440e5e75669" kindref="member">minor</ref><sp/>=<sp/>FTDI_MINOR_VERSION;</highlight></codeline>
<codeline lineno="287"><highlight class="normal"><sp/><sp/><sp/><sp/>ver.<ref refid="structftdi__version__info_1ab5dd11d114d02d509e2bf83eea4d180a" kindref="member">micro</ref><sp/>=<sp/>FTDI_MICRO_VERSION;</highlight></codeline>
<codeline lineno="288"><highlight class="normal"><sp/><sp/><sp/><sp/>ver.<ref refid="structftdi__version__info_1af5581f9a5c2c2d03551bc1d8d0f026a1" kindref="member">version_str</ref><sp/>=<sp/>FTDI_VERSION_STRING;</highlight></codeline>
<codeline lineno="289"><highlight class="normal"><sp/><sp/><sp/><sp/>ver.<ref refid="structftdi__version__info_1ae56ef54eaad3de9ced05282eb3cce62c" kindref="member">snapshot_str</ref><sp/>=<sp/>FTDI_SNAPSHOT_VERSION;</highlight></codeline>
<codeline lineno="290"><highlight class="normal"></highlight></codeline>
<codeline lineno="291"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ver;</highlight></codeline>
<codeline lineno="292"><highlight class="normal">}</highlight></codeline>
<codeline lineno="293"><highlight class="normal"></highlight></codeline>
<codeline lineno="310" refid="group__libftdi_1ga2845a0c63809747c9c7b1ea404453bc4" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga2845a0c63809747c9c7b1ea404453bc4" kindref="member">ftdi_usb_find_all</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__device__list" kindref="compound" tooltip="list of usb devices created by ftdi_usb_find_all()">ftdi_device_list</ref><sp/>**devlist,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>vendor,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>product)</highlight></codeline>
<codeline lineno="311"><highlight class="normal">{</highlight></codeline>
<codeline lineno="312"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__device__list" kindref="compound" tooltip="list of usb devices created by ftdi_usb_find_all()">ftdi_device_list</ref><sp/>**curdev;</highlight></codeline>
<codeline lineno="313"><highlight class="normal"><sp/><sp/><sp/><sp/>libusb_device<sp/>*<ref refid="structftdi__device__list_1aa8d986c61599a7f52a4d2fa1da434a37" kindref="member">dev</ref>;</highlight></codeline>
<codeline lineno="314"><highlight class="normal"><sp/><sp/><sp/><sp/>libusb_device<sp/>**devs;</highlight></codeline>
<codeline lineno="315"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>count<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="317"><highlight class="normal"></highlight></codeline>
<codeline lineno="318"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_device_list(ftdi-&gt;<ref refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" kindref="member">usb_ctx</ref>,<sp/>&amp;devs)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-5,<sp/></highlight><highlight class="stringliteral">&quot;libusb_get_device_list()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="320"><highlight class="normal"></highlight></codeline>
<codeline lineno="321"><highlight class="normal"><sp/><sp/><sp/><sp/>curdev<sp/>=<sp/>devlist;</highlight></codeline>
<codeline lineno="322"><highlight class="normal"><sp/><sp/><sp/><sp/>*curdev<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="323"><highlight class="normal"></highlight></codeline>
<codeline lineno="324"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>((dev<sp/>=<sp/>devs[i++])<sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="325"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="326"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">libusb_device_descriptor<sp/>desc;</highlight></codeline>
<codeline lineno="327"><highlight class="normal"></highlight></codeline>
<codeline lineno="328"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_device_descriptor(dev,<sp/>&amp;desc)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="329"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" kindref="member">ftdi_error_return_free_device_list</ref>(-6,<sp/></highlight><highlight class="stringliteral">&quot;libusb_get_device_descriptor()<sp/>failed&quot;</highlight><highlight class="normal">,<sp/>devs);</highlight></codeline>
<codeline lineno="330"><highlight class="normal"></highlight></codeline>
<codeline lineno="331"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(((vendor<sp/>!=<sp/>0<sp/>&amp;&amp;<sp/>product<sp/>!=<sp/>0)<sp/>&amp;&amp;<sp/></highlight></codeline>
<codeline lineno="332"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>desc.idVendor<sp/>==<sp/>vendor<sp/>&amp;&amp;<sp/>desc.idProduct<sp/>==<sp/>product)<sp/>||</highlight></codeline>
<codeline lineno="333"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>((vendor<sp/>==<sp/>0<sp/>&amp;&amp;<sp/>product<sp/>==<sp/>0)<sp/>&amp;&amp;<sp/></highlight></codeline>
<codeline lineno="334"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(desc.idVendor<sp/>==<sp/>0x403)<sp/>&amp;&amp;<sp/>(desc.idProduct<sp/>==<sp/>0x6001<sp/>||<sp/>desc.idProduct<sp/>==<sp/>0x6010</highlight></codeline>
<codeline lineno="335"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>||<sp/>desc.idProduct<sp/>==<sp/>0x6011<sp/>||<sp/>desc.idProduct<sp/>==<sp/>0x6014)))</highlight></codeline>
<codeline lineno="336"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="337"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*curdev<sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__device__list" kindref="compound" tooltip="list of usb devices created by ftdi_usb_find_all()">ftdi_device_list</ref>*)malloc(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__device__list" kindref="compound" tooltip="list of usb devices created by ftdi_usb_find_all()">ftdi_device_list</ref>));</highlight></codeline>
<codeline lineno="338"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!*curdev)</highlight></codeline>
<codeline lineno="339"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" kindref="member">ftdi_error_return_free_device_list</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;out<sp/>of<sp/>memory&quot;</highlight><highlight class="normal">,<sp/>devs);</highlight></codeline>
<codeline lineno="340"><highlight class="normal"></highlight></codeline>
<codeline lineno="341"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(*curdev)-&gt;next<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="342"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(*curdev)-&gt;dev<sp/>=<sp/><ref refid="structftdi__device__list_1aa8d986c61599a7f52a4d2fa1da434a37" kindref="member">dev</ref>;</highlight></codeline>
<codeline lineno="343"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_ref_device(dev);</highlight></codeline>
<codeline lineno="344"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>curdev<sp/>=<sp/>&amp;(*curdev)-&gt;<ref refid="structftdi__device__list_1aa80d0234b1a36e0e9a91605a7c74df37" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="345"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>count++;</highlight></codeline>
<codeline lineno="346"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="347"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="348"><highlight class="normal"><sp/><sp/><sp/><sp/>libusb_free_device_list(devs,1);</highlight></codeline>
<codeline lineno="349"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>count;</highlight></codeline>
<codeline lineno="350"><highlight class="normal">}</highlight></codeline>
<codeline lineno="351"><highlight class="normal"></highlight></codeline>
<codeline lineno="357" refid="group__libftdi_1ga35358ea578644aa309300db782415c9f" refkind="member"><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga35358ea578644aa309300db782415c9f" kindref="member">ftdi_list_free</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__device__list" kindref="compound" tooltip="list of usb devices created by ftdi_usb_find_all()">ftdi_device_list</ref><sp/>**devlist)</highlight></codeline>
<codeline lineno="358"><highlight class="normal">{</highlight></codeline>
<codeline lineno="359"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__device__list" kindref="compound" tooltip="list of usb devices created by ftdi_usb_find_all()">ftdi_device_list</ref><sp/>*curdev,<sp/>*<ref refid="structftdi__device__list_1aa80d0234b1a36e0e9a91605a7c74df37" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="360"><highlight class="normal"></highlight></codeline>
<codeline lineno="361"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(curdev<sp/>=<sp/>*devlist;<sp/>curdev<sp/>!=<sp/>NULL;)</highlight></codeline>
<codeline lineno="362"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="363"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>next<sp/>=<sp/>curdev-&gt;<ref refid="structftdi__device__list_1aa80d0234b1a36e0e9a91605a7c74df37" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="364"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_unref_device(curdev-&gt;<ref refid="structftdi__device__list_1aa8d986c61599a7f52a4d2fa1da434a37" kindref="member">dev</ref>);</highlight></codeline>
<codeline lineno="365"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(curdev);</highlight></codeline>
<codeline lineno="366"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>curdev<sp/>=<sp/><ref refid="structftdi__device__list_1aa80d0234b1a36e0e9a91605a7c74df37" kindref="member">next</ref>;</highlight></codeline>
<codeline lineno="367"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="368"><highlight class="normal"></highlight></codeline>
<codeline lineno="369"><highlight class="normal"><sp/><sp/><sp/><sp/>*devlist<sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="370"><highlight class="normal">}</highlight></codeline>
<codeline lineno="371"><highlight class="normal"></highlight></codeline>
<codeline lineno="377" refid="group__libftdi_1gaa4838bebb2024ae9bfdcc81adbda3493" refkind="member"><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gaa4838bebb2024ae9bfdcc81adbda3493" kindref="member">ftdi_list_free2</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__device__list" kindref="compound" tooltip="list of usb devices created by ftdi_usb_find_all()">ftdi_device_list</ref><sp/>*devlist)</highlight></codeline>
<codeline lineno="378"><highlight class="normal">{</highlight></codeline>
<codeline lineno="379"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga35358ea578644aa309300db782415c9f" kindref="member">ftdi_list_free</ref>(&amp;devlist);</highlight></codeline>
<codeline lineno="380"><highlight class="normal">}</highlight></codeline>
<codeline lineno="381"><highlight class="normal"></highlight></codeline>
<codeline lineno="408" refid="group__libftdi_1ga17e8eae09e58bd3bfeeab8decfce7fd9" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga17e8eae09e58bd3bfeeab8decfce7fd9" kindref="member">ftdi_usb_get_strings</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*<sp/>ftdi,<sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/>libusb_device<sp/>*<sp/><ref refid="structftdi__device__list_1aa8d986c61599a7f52a4d2fa1da434a37" kindref="member">dev</ref>,</highlight></codeline>
<codeline lineno="409"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>manufacturer,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>mnf_len,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>description,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>desc_len,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>serial,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>serial_len)</highlight></codeline>
<codeline lineno="410"><highlight class="normal">{</highlight></codeline>
<codeline lineno="411"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">libusb_device_descriptor<sp/>desc;</highlight></codeline>
<codeline lineno="412"><highlight class="normal"></highlight></codeline>
<codeline lineno="413"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ftdi==NULL)<sp/>||<sp/>(dev==NULL))</highlight></codeline>
<codeline lineno="414"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="415"><highlight class="normal"></highlight></codeline>
<codeline lineno="416"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_open(dev,<sp/>&amp;ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="417"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-4,<sp/></highlight><highlight class="stringliteral">&quot;libusb_open()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="418"><highlight class="normal"></highlight></codeline>
<codeline lineno="419"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_device_descriptor(dev,<sp/>&amp;desc)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="420"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-11,<sp/></highlight><highlight class="stringliteral">&quot;libusb_get_device_descriptor()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="421"><highlight class="normal"></highlight></codeline>
<codeline lineno="422"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(manufacturer<sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="423"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="424"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_string_descriptor_ascii(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>desc.iManufacturer,<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)manufacturer,<sp/>mnf_len)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="425"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="426"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="427"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-7,<sp/></highlight><highlight class="stringliteral">&quot;libusb_get_string_descriptor_ascii()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="428"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="429"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="430"><highlight class="normal"></highlight></codeline>
<codeline lineno="431"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(description<sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="432"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="433"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_string_descriptor_ascii(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>desc.iProduct,<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)description,<sp/>desc_len)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="434"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="435"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="436"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-8,<sp/></highlight><highlight class="stringliteral">&quot;libusb_get_string_descriptor_ascii()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="437"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="438"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="439"><highlight class="normal"></highlight></codeline>
<codeline lineno="440"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(serial<sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="441"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="442"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_string_descriptor_ascii(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>desc.iSerialNumber,<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)serial,<sp/>serial_len)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="443"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="444"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="445"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-9,<sp/></highlight><highlight class="stringliteral">&quot;libusb_get_string_descriptor_ascii()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="446"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="447"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="448"><highlight class="normal"></highlight></codeline>
<codeline lineno="449"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="450"><highlight class="normal"></highlight></codeline>
<codeline lineno="451"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="452"><highlight class="normal">}</highlight></codeline>
<codeline lineno="453"><highlight class="normal"></highlight></codeline>
<codeline lineno="460"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>_ftdi_determine_max_packet_size(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/>libusb_device<sp/>*dev)</highlight></codeline>
<codeline lineno="461"><highlight class="normal">{</highlight></codeline>
<codeline lineno="462"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">libusb_device_descriptor<sp/>desc;</highlight></codeline>
<codeline lineno="463"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">libusb_config_descriptor<sp/>*config0;</highlight></codeline>
<codeline lineno="464"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>packet_size;</highlight></codeline>
<codeline lineno="465"><highlight class="normal"></highlight></codeline>
<codeline lineno="466"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Sanity<sp/>check</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="467"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>dev<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="468"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>64;</highlight></codeline>
<codeline lineno="469"><highlight class="normal"></highlight></codeline>
<codeline lineno="470"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Determine<sp/>maximum<sp/>packet<sp/>size.<sp/>Init<sp/>with<sp/>default<sp/>value.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="471"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>New<sp/>hi-speed<sp/>devices<sp/>from<sp/>FTDI<sp/>use<sp/>a<sp/>packet<sp/>size<sp/>of<sp/>512<sp/>bytes</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="472"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>but<sp/>could<sp/>be<sp/>connected<sp/>to<sp/>a<sp/>normal<sp/>speed<sp/>USB<sp/>hub<sp/>-&gt;<sp/>64<sp/>bytes<sp/>packet<sp/>size.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="473"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref><sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref><sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref><sp/>)</highlight></codeline>
<codeline lineno="474"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>packet_size<sp/>=<sp/>512;</highlight></codeline>
<codeline lineno="475"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="476"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>packet_size<sp/>=<sp/>64;</highlight></codeline>
<codeline lineno="477"><highlight class="normal"></highlight></codeline>
<codeline lineno="478"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_device_descriptor(dev,<sp/>&amp;desc)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="479"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>packet_size;</highlight></codeline>
<codeline lineno="480"><highlight class="normal"></highlight></codeline>
<codeline lineno="481"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_config_descriptor(dev,<sp/>0,<sp/>&amp;config0)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="482"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>packet_size;</highlight></codeline>
<codeline lineno="483"><highlight class="normal"></highlight></codeline>
<codeline lineno="484"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(desc.bNumConfigurations<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="485"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="486"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" kindref="member">interface</ref><sp/>&lt;<sp/>config0-&gt;bNumInterfaces)</highlight></codeline>
<codeline lineno="487"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="488"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">libusb_interface<sp/>interface<sp/>=<sp/>config0-&gt;interface[ftdi-&gt;<ref refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" kindref="member">interface</ref>];</highlight></codeline>
<codeline lineno="489"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(interface.num_altsetting<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="490"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="491"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">libusb_interface_descriptor<sp/>descriptor<sp/>=<sp/>interface.altsetting[0];</highlight></codeline>
<codeline lineno="492"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(descriptor.bNumEndpoints<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="493"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="494"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>packet_size<sp/>=<sp/>descriptor.endpoint[0].wMaxPacketSize;</highlight></codeline>
<codeline lineno="495"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="496"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="497"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="498"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="499"><highlight class="normal"></highlight></codeline>
<codeline lineno="500"><highlight class="normal"><sp/><sp/><sp/><sp/>libusb_free_config_descriptor<sp/>(config0);</highlight></codeline>
<codeline lineno="501"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>packet_size;</highlight></codeline>
<codeline lineno="502"><highlight class="normal">}</highlight></codeline>
<codeline lineno="503"><highlight class="normal"></highlight></codeline>
<codeline lineno="522" refid="group__libftdi_1ga07d90df83e677ad08fe551de17fd7a41" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga07d90df83e677ad08fe551de17fd7a41" kindref="member">ftdi_usb_open_dev</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/>libusb_device<sp/>*dev)</highlight></codeline>
<codeline lineno="523"><highlight class="normal">{</highlight></codeline>
<codeline lineno="524"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">libusb_device_descriptor<sp/>desc;</highlight></codeline>
<codeline lineno="525"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">libusb_config_descriptor<sp/>*config0;</highlight></codeline>
<codeline lineno="526"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>cfg,<sp/>cfg0,<sp/>detach_errno<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="527"><highlight class="normal"></highlight></codeline>
<codeline lineno="528"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="529"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-8,<sp/></highlight><highlight class="stringliteral">&quot;ftdi<sp/>context<sp/>invalid&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="530"><highlight class="normal"></highlight></codeline>
<codeline lineno="531"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_open(dev,<sp/>&amp;ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="532"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-4,<sp/></highlight><highlight class="stringliteral">&quot;libusb_open()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="533"><highlight class="normal"></highlight></codeline>
<codeline lineno="534"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_device_descriptor(dev,<sp/>&amp;desc)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="535"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-9,<sp/></highlight><highlight class="stringliteral">&quot;libusb_get_device_descriptor()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="536"><highlight class="normal"></highlight></codeline>
<codeline lineno="537"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_config_descriptor(dev,<sp/>0,<sp/>&amp;config0)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="538"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-10,<sp/></highlight><highlight class="stringliteral">&quot;libusb_get_config_descriptor()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="539"><highlight class="normal"><sp/><sp/><sp/><sp/>cfg0<sp/>=<sp/>config0-&gt;bConfigurationValue;</highlight></codeline>
<codeline lineno="540"><highlight class="normal"><sp/><sp/><sp/><sp/>libusb_free_config_descriptor<sp/>(config0);</highlight></codeline>
<codeline lineno="541"><highlight class="normal"></highlight></codeline>
<codeline lineno="542"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Try<sp/>to<sp/>detach<sp/>ftdi_sio<sp/>kernel<sp/>module.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="543"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="544"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>The<sp/>return<sp/>code<sp/>is<sp/>kept<sp/>in<sp/>a<sp/>separate<sp/>variable<sp/>and<sp/>only<sp/>parsed</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="545"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>if<sp/>usb_set_configuration()<sp/>or<sp/>usb_claim_interface()<sp/>fails<sp/>as<sp/>the</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="546"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>detach<sp/>operation<sp/>might<sp/>be<sp/>denied<sp/>and<sp/>everything<sp/>still<sp/>works<sp/>fine.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="547"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Likely<sp/>scenario<sp/>is<sp/>a<sp/>static<sp/>ftdi_sio<sp/>kernel<sp/>module.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="548"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a06072f2484298ae90fcffe450a133250" kindref="member">module_detach_mode</ref><sp/>==<sp/><ref refid="ftdi_8h_1adb5c9021fa85791df4a0b9dac671109aa3fde2d289c2051df02332045e58f4a76" kindref="member">AUTO_DETACH_SIO_MODULE</ref>)</highlight></codeline>
<codeline lineno="549"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="550"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_detach_kernel_driver(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" kindref="member">interface</ref>)<sp/>!=0)</highlight></codeline>
<codeline lineno="551"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>detach_errno<sp/>=<sp/>errno;</highlight></codeline>
<codeline lineno="552"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="553"><highlight class="normal"></highlight></codeline>
<codeline lineno="554"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_configuration<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>&amp;cfg)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="555"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-12,<sp/></highlight><highlight class="stringliteral">&quot;libusb_get_configuration<sp/>()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="556"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>set<sp/>configuration<sp/>(needed<sp/>especially<sp/>for<sp/>windows)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="557"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>tolerate<sp/>EBUSY:<sp/>one<sp/>device<sp/>with<sp/>one<sp/>configuration,<sp/>but<sp/>two<sp/>interfaces</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="558"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/><sp/><sp/><sp/>and<sp/>libftdi<sp/>sessions<sp/>to<sp/>both<sp/>interfaces<sp/>(e.g.<sp/>FT2232)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="559"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(desc.bNumConfigurations<sp/>&gt;<sp/>0<sp/>&amp;&amp;<sp/>cfg<sp/>!=<sp/>cfg0)</highlight></codeline>
<codeline lineno="560"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="561"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_set_configuration(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>cfg0)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="562"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="563"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="564"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(detach_errno<sp/>==<sp/>EPERM)</highlight></codeline>
<codeline lineno="565"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="566"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-8,<sp/></highlight><highlight class="stringliteral">&quot;inappropriate<sp/>permissions<sp/>on<sp/>device!&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="567"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="568"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="569"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="570"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;unable<sp/>to<sp/>set<sp/>usb<sp/>configuration.<sp/>Make<sp/>sure<sp/>the<sp/>default<sp/>FTDI<sp/>driver<sp/>is<sp/>not<sp/>in<sp/>use&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="571"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="572"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="573"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="574"><highlight class="normal"></highlight></codeline>
<codeline lineno="575"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_claim_interface(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" kindref="member">interface</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="576"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="577"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="578"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(detach_errno<sp/>==<sp/>EPERM)</highlight></codeline>
<codeline lineno="579"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="580"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-8,<sp/></highlight><highlight class="stringliteral">&quot;inappropriate<sp/>permissions<sp/>on<sp/>device!&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="581"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="582"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="583"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="584"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-5,<sp/></highlight><highlight class="stringliteral">&quot;unable<sp/>to<sp/>claim<sp/>usb<sp/>device.<sp/>Make<sp/>sure<sp/>the<sp/>default<sp/>FTDI<sp/>driver<sp/>is<sp/>not<sp/>in<sp/>use&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="585"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="586"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="587"><highlight class="normal"></highlight></codeline>
<codeline lineno="588"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="group__libftdi_1ga266ccc351ea31289022063a8ae29edf4" kindref="member">ftdi_usb_reset</ref><sp/>(ftdi)<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="589"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="590"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="591"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-6,<sp/></highlight><highlight class="stringliteral">&quot;ftdi_usb_reset<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="592"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="593"><highlight class="normal"></highlight></codeline>
<codeline lineno="594"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Try<sp/>to<sp/>guess<sp/>chip<sp/>type</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="595"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bug<sp/>in<sp/>the<sp/>BM<sp/>type<sp/>chips:<sp/>bcdDevice<sp/>is<sp/>0x200<sp/>for<sp/>serial<sp/>==<sp/>0</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="596"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(desc.bcdDevice<sp/>==<sp/>0x400<sp/>||<sp/>(desc.bcdDevice<sp/>==<sp/>0x200</highlight></codeline>
<codeline lineno="597"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;&amp;<sp/>desc.iSerialNumber<sp/>==<sp/>0))</highlight></codeline>
<codeline lineno="598"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>;</highlight></codeline>
<codeline lineno="599"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(desc.bcdDevice<sp/>==<sp/>0x200)</highlight></codeline>
<codeline lineno="600"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" kindref="member">TYPE_AM</ref>;</highlight></codeline>
<codeline lineno="601"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(desc.bcdDevice<sp/>==<sp/>0x500)</highlight></codeline>
<codeline lineno="602"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>;</highlight></codeline>
<codeline lineno="603"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(desc.bcdDevice<sp/>==<sp/>0x600)</highlight></codeline>
<codeline lineno="604"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>;</highlight></codeline>
<codeline lineno="605"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(desc.bcdDevice<sp/>==<sp/>0x700)</highlight></codeline>
<codeline lineno="606"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>;</highlight></codeline>
<codeline lineno="607"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(desc.bcdDevice<sp/>==<sp/>0x800)</highlight></codeline>
<codeline lineno="608"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref>;</highlight></codeline>
<codeline lineno="609"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(desc.bcdDevice<sp/>==<sp/>0x900)</highlight></codeline>
<codeline lineno="610"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>;</highlight></codeline>
<codeline lineno="611"><highlight class="normal"></highlight></codeline>
<codeline lineno="612"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Determine<sp/>maximum<sp/>packet<sp/>size</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="613"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a7ca2f7e68cd28e1c3079d029fd6129c0" kindref="member">max_packet_size</ref><sp/>=<sp/>_ftdi_determine_max_packet_size(ftdi,<sp/>dev);</highlight></codeline>
<codeline lineno="614"><highlight class="normal"></highlight></codeline>
<codeline lineno="615"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="group__libftdi_1gae80f1dc38f5c80946a56ec34a329e7f5" kindref="member">ftdi_set_baudrate</ref><sp/>(ftdi,<sp/>9600)<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="616"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="617"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="618"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-7,<sp/></highlight><highlight class="stringliteral">&quot;set<sp/>baudrate<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="619"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="620"><highlight class="normal"></highlight></codeline>
<codeline lineno="621"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(0,<sp/></highlight><highlight class="stringliteral">&quot;all<sp/>fine&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="622"><highlight class="normal">}</highlight></codeline>
<codeline lineno="623"><highlight class="normal"></highlight></codeline>
<codeline lineno="633" refid="group__libftdi_1ga95d4689db18fc1fd70011f6504ab8c40" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga95d4689db18fc1fd70011f6504ab8c40" kindref="member">ftdi_usb_open</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>vendor,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>product)</highlight></codeline>
<codeline lineno="634"><highlight class="normal">{</highlight></codeline>
<codeline lineno="635"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga93c2c5f546f5968ae497c099d319ff32" kindref="member">ftdi_usb_open_desc</ref>(ftdi,<sp/>vendor,<sp/>product,<sp/>NULL,<sp/>NULL);</highlight></codeline>
<codeline lineno="636"><highlight class="normal">}</highlight></codeline>
<codeline lineno="637"><highlight class="normal"></highlight></codeline>
<codeline lineno="659" refid="group__libftdi_1ga93c2c5f546f5968ae497c099d319ff32" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga93c2c5f546f5968ae497c099d319ff32" kindref="member">ftdi_usb_open_desc</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>vendor,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>product,</highlight></codeline>
<codeline lineno="660"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>description,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>serial)</highlight></codeline>
<codeline lineno="661"><highlight class="normal">{</highlight></codeline>
<codeline lineno="662"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga3c5ccb0678b0e268b4081ea978e8eb78" kindref="member">ftdi_usb_open_desc_index</ref>(ftdi,vendor,product,description,serial,0);</highlight></codeline>
<codeline lineno="663"><highlight class="normal">}</highlight></codeline>
<codeline lineno="664"><highlight class="normal"></highlight></codeline>
<codeline lineno="689" refid="group__libftdi_1ga3c5ccb0678b0e268b4081ea978e8eb78" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga3c5ccb0678b0e268b4081ea978e8eb78" kindref="member">ftdi_usb_open_desc_index</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>vendor,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>product,</highlight></codeline>
<codeline lineno="690"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>description,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>serial,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>index)</highlight></codeline>
<codeline lineno="691"><highlight class="normal">{</highlight></codeline>
<codeline lineno="692"><highlight class="normal"><sp/><sp/><sp/><sp/>libusb_device<sp/>*dev;</highlight></codeline>
<codeline lineno="693"><highlight class="normal"><sp/><sp/><sp/><sp/>libusb_device<sp/>**devs;</highlight></codeline>
<codeline lineno="694"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">string</highlight><highlight class="normal">[256];</highlight></codeline>
<codeline lineno="695"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="696"><highlight class="normal"></highlight></codeline>
<codeline lineno="697"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="698"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-11,<sp/></highlight><highlight class="stringliteral">&quot;ftdi<sp/>context<sp/>invalid&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="699"><highlight class="normal"></highlight></codeline>
<codeline lineno="700"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_device_list(ftdi-&gt;<ref refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" kindref="member">usb_ctx</ref>,<sp/>&amp;devs)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="701"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-12,<sp/></highlight><highlight class="stringliteral">&quot;libusb_get_device_list()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="702"><highlight class="normal"></highlight></codeline>
<codeline lineno="703"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>((dev<sp/>=<sp/>devs[i++])<sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="704"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="705"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">libusb_device_descriptor<sp/>desc;</highlight></codeline>
<codeline lineno="706"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>res;</highlight></codeline>
<codeline lineno="707"><highlight class="normal"></highlight></codeline>
<codeline lineno="708"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_device_descriptor(dev,<sp/>&amp;desc)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="709"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" kindref="member">ftdi_error_return_free_device_list</ref>(-13,<sp/></highlight><highlight class="stringliteral">&quot;libusb_get_device_descriptor()<sp/>failed&quot;</highlight><highlight class="normal">,<sp/>devs);</highlight></codeline>
<codeline lineno="710"><highlight class="normal"></highlight></codeline>
<codeline lineno="711"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(desc.idVendor<sp/>==<sp/>vendor<sp/>&amp;&amp;<sp/>desc.idProduct<sp/>==<sp/>product)</highlight></codeline>
<codeline lineno="712"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="713"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_open(dev,<sp/>&amp;ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="714"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" kindref="member">ftdi_error_return_free_device_list</ref>(-4,<sp/></highlight><highlight class="stringliteral">&quot;usb_open()<sp/>failed&quot;</highlight><highlight class="normal">,<sp/>devs);</highlight></codeline>
<codeline lineno="715"><highlight class="normal"></highlight></codeline>
<codeline lineno="716"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(description<sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="717"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="718"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_string_descriptor_ascii(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>desc.iProduct,<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">))<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="719"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="720"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="721"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" kindref="member">ftdi_error_return_free_device_list</ref>(-8,<sp/></highlight><highlight class="stringliteral">&quot;unable<sp/>to<sp/>fetch<sp/>product<sp/>description&quot;</highlight><highlight class="normal">,<sp/>devs);</highlight></codeline>
<codeline lineno="722"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="723"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strncmp(</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">,<sp/>description,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">))<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="724"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="725"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="726"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">continue</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="727"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="728"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="729"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(serial<sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="730"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="731"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_string_descriptor_ascii(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>desc.iSerialNumber,<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">))<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="732"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="733"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="734"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" kindref="member">ftdi_error_return_free_device_list</ref>(-9,<sp/></highlight><highlight class="stringliteral">&quot;unable<sp/>to<sp/>fetch<sp/>serial<sp/>number&quot;</highlight><highlight class="normal">,<sp/>devs);</highlight></codeline>
<codeline lineno="735"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="736"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strncmp(</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">,<sp/>serial,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keywordtype">string</highlight><highlight class="normal">))<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="737"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="738"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="739"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">continue</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="740"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="741"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="742"><highlight class="normal"></highlight></codeline>
<codeline lineno="743"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="744"><highlight class="normal"></highlight></codeline>
<codeline lineno="745"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(index<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="746"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="747"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>index--;</highlight></codeline>
<codeline lineno="748"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">continue</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="749"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="750"><highlight class="normal"></highlight></codeline>
<codeline lineno="751"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>res<sp/>=<sp/><ref refid="group__libftdi_1ga07d90df83e677ad08fe551de17fd7a41" kindref="member">ftdi_usb_open_dev</ref>(ftdi,<sp/>dev);</highlight></codeline>
<codeline lineno="752"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_free_device_list(devs,1);</highlight></codeline>
<codeline lineno="753"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>res;</highlight></codeline>
<codeline lineno="754"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="755"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="756"><highlight class="normal"></highlight></codeline>
<codeline lineno="757"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>device<sp/>not<sp/>found</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="758"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" kindref="member">ftdi_error_return_free_device_list</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;device<sp/>not<sp/>found&quot;</highlight><highlight class="normal">,<sp/>devs);</highlight></codeline>
<codeline lineno="759"><highlight class="normal">}</highlight></codeline>
<codeline lineno="760"><highlight class="normal"></highlight></codeline>
<codeline lineno="787" refid="group__libftdi_1gaae805b82251a61dae46b98345cd84d5c" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gaae805b82251a61dae46b98345cd84d5c" kindref="member">ftdi_usb_open_string</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>description)</highlight></codeline>
<codeline lineno="788"><highlight class="normal">{</highlight></codeline>
<codeline lineno="789"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="790"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-12,<sp/></highlight><highlight class="stringliteral">&quot;ftdi<sp/>context<sp/>invalid&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="791"><highlight class="normal"></highlight></codeline>
<codeline lineno="792"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(description[0]<sp/>==<sp/>0<sp/>||<sp/>description[1]<sp/>!=<sp/></highlight><highlight class="charliteral">&apos;:&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="793"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-11,<sp/></highlight><highlight class="stringliteral">&quot;illegal<sp/>description<sp/>format&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="794"><highlight class="normal"></highlight></codeline>
<codeline lineno="795"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(description[0]<sp/>==<sp/></highlight><highlight class="charliteral">&apos;d&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="796"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="797"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_device<sp/>*dev;</highlight></codeline>
<codeline lineno="798"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_device<sp/>**devs;</highlight></codeline>
<codeline lineno="799"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>bus_number,<sp/>device_address;</highlight></codeline>
<codeline lineno="800"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="801"><highlight class="normal"></highlight></codeline>
<codeline lineno="802"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_get_device_list(ftdi-&gt;<ref refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" kindref="member">usb_ctx</ref>,<sp/>&amp;devs)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="803"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;libusb_get_device_list()<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="804"><highlight class="normal"></highlight></codeline>
<codeline lineno="805"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>XXX:<sp/>This<sp/>doesn&apos;t<sp/>handle<sp/>symlinks/odd<sp/>paths/etc...<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="806"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(sscanf<sp/>(description<sp/>+<sp/>2,<sp/></highlight><highlight class="stringliteral">&quot;%u/%u&quot;</highlight><highlight class="normal">,<sp/>&amp;bus_number,<sp/>&amp;device_address)<sp/>!=<sp/>2)</highlight></codeline>
<codeline lineno="807"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" kindref="member">ftdi_error_return_free_device_list</ref>(-11,<sp/></highlight><highlight class="stringliteral">&quot;illegal<sp/>description<sp/>format&quot;</highlight><highlight class="normal">,<sp/>devs);</highlight></codeline>
<codeline lineno="808"><highlight class="normal"></highlight></codeline>
<codeline lineno="809"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>((dev<sp/>=<sp/>devs[i++])<sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="810"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="811"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="812"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(bus_number<sp/>==<sp/>libusb_get_bus_number<sp/>(dev)</highlight></codeline>
<codeline lineno="813"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;&amp;<sp/>device_address<sp/>==<sp/>libusb_get_device_address<sp/>(dev))</highlight></codeline>
<codeline lineno="814"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="815"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/><ref refid="group__libftdi_1ga07d90df83e677ad08fe551de17fd7a41" kindref="member">ftdi_usb_open_dev</ref>(ftdi,<sp/>dev);</highlight></codeline>
<codeline lineno="816"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_free_device_list(devs,1);</highlight></codeline>
<codeline lineno="817"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="818"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="819"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="820"><highlight class="normal"></highlight></codeline>
<codeline lineno="821"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>device<sp/>not<sp/>found</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="822"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga4ceb56112022b39be216a40ab52cd9a8" kindref="member">ftdi_error_return_free_device_list</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;device<sp/>not<sp/>found&quot;</highlight><highlight class="normal">,<sp/>devs);</highlight></codeline>
<codeline lineno="823"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="824"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(description[0]<sp/>==<sp/></highlight><highlight class="charliteral">&apos;i&apos;</highlight><highlight class="normal"><sp/>||<sp/>description[0]<sp/>==<sp/></highlight><highlight class="charliteral">&apos;s&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="825"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="826"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>vendor;</highlight></codeline>
<codeline lineno="827"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>product;</highlight></codeline>
<codeline lineno="828"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>index=0;</highlight></codeline>
<codeline lineno="829"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*serial=NULL;</highlight></codeline>
<codeline lineno="830"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*startp,<sp/>*endp;</highlight></codeline>
<codeline lineno="831"><highlight class="normal"></highlight></codeline>
<codeline lineno="832"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>errno=0;</highlight></codeline>
<codeline lineno="833"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>startp=description+2;</highlight></codeline>
<codeline lineno="834"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vendor=strtoul((</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*)startp,(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">**)&amp;endp,0);</highlight></codeline>
<codeline lineno="835"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*endp<sp/>!=<sp/></highlight><highlight class="charliteral">&apos;:&apos;</highlight><highlight class="normal"><sp/>||<sp/>endp<sp/>==<sp/>startp<sp/>||<sp/>errno<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="836"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-11,<sp/></highlight><highlight class="stringliteral">&quot;illegal<sp/>description<sp/>format&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="837"><highlight class="normal"></highlight></codeline>
<codeline lineno="838"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>startp=endp+1;</highlight></codeline>
<codeline lineno="839"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>product=strtoul((</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*)startp,(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">**)&amp;endp,0);</highlight></codeline>
<codeline lineno="840"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(endp<sp/>==<sp/>startp<sp/>||<sp/>errno<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="841"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-11,<sp/></highlight><highlight class="stringliteral">&quot;illegal<sp/>description<sp/>format&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="842"><highlight class="normal"></highlight></codeline>
<codeline lineno="843"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(description[0]<sp/>==<sp/></highlight><highlight class="charliteral">&apos;i&apos;</highlight><highlight class="normal"><sp/>&amp;&amp;<sp/>*endp<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="844"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="845"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>optional<sp/>index<sp/>field<sp/>in<sp/>i-mode<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="846"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*endp<sp/>!=<sp/></highlight><highlight class="charliteral">&apos;:&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="847"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-11,<sp/></highlight><highlight class="stringliteral">&quot;illegal<sp/>description<sp/>format&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="848"><highlight class="normal"></highlight></codeline>
<codeline lineno="849"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>startp=endp+1;</highlight></codeline>
<codeline lineno="850"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>index=strtoul((</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*)startp,(</highlight><highlight class="keywordtype">char</highlight><highlight class="normal">**)&amp;endp,0);</highlight></codeline>
<codeline lineno="851"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*endp<sp/>!=<sp/>0<sp/>||<sp/>endp<sp/>==<sp/>startp<sp/>||<sp/>errno<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="852"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-11,<sp/></highlight><highlight class="stringliteral">&quot;illegal<sp/>description<sp/>format&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="853"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="854"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(description[0]<sp/>==<sp/></highlight><highlight class="charliteral">&apos;s&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="855"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="856"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*endp<sp/>!=<sp/></highlight><highlight class="charliteral">&apos;:&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="857"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-11,<sp/></highlight><highlight class="stringliteral">&quot;illegal<sp/>description<sp/>format&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="858"><highlight class="normal"></highlight></codeline>
<codeline lineno="859"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>rest<sp/>of<sp/>the<sp/>description<sp/>is<sp/>the<sp/>serial<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="860"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>serial=endp+1;</highlight></codeline>
<codeline lineno="861"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="862"><highlight class="normal"></highlight></codeline>
<codeline lineno="863"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga3c5ccb0678b0e268b4081ea978e8eb78" kindref="member">ftdi_usb_open_desc_index</ref>(ftdi,<sp/>vendor,<sp/>product,<sp/>NULL,<sp/>serial,<sp/>index);</highlight></codeline>
<codeline lineno="864"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="865"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="866"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="867"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-11,<sp/></highlight><highlight class="stringliteral">&quot;illegal<sp/>description<sp/>format&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="868"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="869"><highlight class="normal">}</highlight></codeline>
<codeline lineno="870"><highlight class="normal"></highlight></codeline>
<codeline lineno="880" refid="group__libftdi_1ga266ccc351ea31289022063a8ae29edf4" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga266ccc351ea31289022063a8ae29edf4" kindref="member">ftdi_usb_reset</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="881"><highlight class="normal">{</highlight></codeline>
<codeline lineno="882"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="883"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="884"><highlight class="normal"></highlight></codeline>
<codeline lineno="885"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,</highlight></codeline>
<codeline lineno="886"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ftdi_8h_1a5950bd59bc692e59e8cc410667c21efb" kindref="member">SIO_RESET_REQUEST</ref>,<sp/><ref refid="ftdi_8h_1ac0a9f9965ee40db86a2e2a0415558ede" kindref="member">SIO_RESET_SIO</ref>,</highlight></codeline>
<codeline lineno="887"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,<sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="888"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,</highlight><highlight class="stringliteral">&quot;FTDI<sp/>reset<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="889"><highlight class="normal"></highlight></codeline>
<codeline lineno="890"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Invalidate<sp/>data<sp/>in<sp/>the<sp/>readbuffer</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="891"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="892"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="893"><highlight class="normal"></highlight></codeline>
<codeline lineno="894"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="895"><highlight class="normal">}</highlight></codeline>
<codeline lineno="896"><highlight class="normal"></highlight></codeline>
<codeline lineno="906" refid="group__libftdi_1ga25a6d4766e30bd47602ed0c0ecf53476" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga25a6d4766e30bd47602ed0c0ecf53476" kindref="member">ftdi_usb_purge_rx_buffer</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="907"><highlight class="normal">{</highlight></codeline>
<codeline lineno="908"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="909"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="910"><highlight class="normal"></highlight></codeline>
<codeline lineno="911"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,</highlight></codeline>
<codeline lineno="912"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ftdi_8h_1a5950bd59bc692e59e8cc410667c21efb" kindref="member">SIO_RESET_REQUEST</ref>,<sp/><ref refid="ftdi_8h_1ae61a2c543abcb5d1423e1a4580c785c5" kindref="member">SIO_RESET_PURGE_RX</ref>,</highlight></codeline>
<codeline lineno="913"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,<sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="914"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;FTDI<sp/>purge<sp/>of<sp/>RX<sp/>buffer<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="915"><highlight class="normal"></highlight></codeline>
<codeline lineno="916"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Invalidate<sp/>data<sp/>in<sp/>the<sp/>readbuffer</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="917"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="918"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="919"><highlight class="normal"></highlight></codeline>
<codeline lineno="920"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="921"><highlight class="normal">}</highlight></codeline>
<codeline lineno="922"><highlight class="normal"></highlight></codeline>
<codeline lineno="932" refid="group__libftdi_1ga1eab1dfd17068c46775a86496fee8bec" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga1eab1dfd17068c46775a86496fee8bec" kindref="member">ftdi_usb_purge_tx_buffer</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="933"><highlight class="normal">{</highlight></codeline>
<codeline lineno="934"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="935"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="936"><highlight class="normal"></highlight></codeline>
<codeline lineno="937"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,</highlight></codeline>
<codeline lineno="938"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ftdi_8h_1a5950bd59bc692e59e8cc410667c21efb" kindref="member">SIO_RESET_REQUEST</ref>,<sp/><ref refid="ftdi_8h_1a318e8a6398bf99f58c1e7fdbaa31f3fb" kindref="member">SIO_RESET_PURGE_TX</ref>,</highlight></codeline>
<codeline lineno="939"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,<sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="940"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;FTDI<sp/>purge<sp/>of<sp/>TX<sp/>buffer<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="941"><highlight class="normal"></highlight></codeline>
<codeline lineno="942"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="943"><highlight class="normal">}</highlight></codeline>
<codeline lineno="944"><highlight class="normal"></highlight></codeline>
<codeline lineno="955" refid="group__libftdi_1ga3089d7ceafad896c007111b8e5c02906" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga3089d7ceafad896c007111b8e5c02906" kindref="member">ftdi_usb_purge_buffers</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="956"><highlight class="normal">{</highlight></codeline>
<codeline lineno="957"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>result;</highlight></codeline>
<codeline lineno="958"><highlight class="normal"></highlight></codeline>
<codeline lineno="959"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="960"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="961"><highlight class="normal"></highlight></codeline>
<codeline lineno="962"><highlight class="normal"><sp/><sp/><sp/><sp/>result<sp/>=<sp/><ref refid="group__libftdi_1ga25a6d4766e30bd47602ed0c0ecf53476" kindref="member">ftdi_usb_purge_rx_buffer</ref>(ftdi);</highlight></codeline>
<codeline lineno="963"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(result<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="964"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="965"><highlight class="normal"></highlight></codeline>
<codeline lineno="966"><highlight class="normal"><sp/><sp/><sp/><sp/>result<sp/>=<sp/><ref refid="group__libftdi_1ga1eab1dfd17068c46775a86496fee8bec" kindref="member">ftdi_usb_purge_tx_buffer</ref>(ftdi);</highlight></codeline>
<codeline lineno="967"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(result<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="968"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-2;</highlight></codeline>
<codeline lineno="969"><highlight class="normal"></highlight></codeline>
<codeline lineno="970"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="971"><highlight class="normal">}</highlight></codeline>
<codeline lineno="972"><highlight class="normal"></highlight></codeline>
<codeline lineno="973"><highlight class="normal"></highlight></codeline>
<codeline lineno="974"><highlight class="normal"></highlight></codeline>
<codeline lineno="984" refid="group__libftdi_1ga9536eff48c7ae9313b2a97320743ee3b" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga9536eff48c7ae9313b2a97320743ee3b" kindref="member">ftdi_usb_close</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="985"><highlight class="normal">{</highlight></codeline>
<codeline lineno="986"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rtn<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="987"><highlight class="normal"></highlight></codeline>
<codeline lineno="988"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="989"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;ftdi<sp/>context<sp/>invalid&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="990"><highlight class="normal"></highlight></codeline>
<codeline lineno="991"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="992"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_release_interface(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ab67b17bd137b3b010544cdc3e6149aa7" kindref="member">interface</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="993"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>rtn<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="994"><highlight class="normal"></highlight></codeline>
<codeline lineno="995"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi_usb_close_internal<sp/>(ftdi);</highlight></codeline>
<codeline lineno="996"><highlight class="normal"></highlight></codeline>
<codeline lineno="997"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>rtn;</highlight></codeline>
<codeline lineno="998"><highlight class="normal">}</highlight></codeline>
<codeline lineno="999"><highlight class="normal"></highlight></codeline>
<codeline lineno="1000"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/>ftdi_to_clkbits_AM<sp/>For<sp/>the<sp/>AM<sp/>device,<sp/>convert<sp/>a<sp/>requested<sp/>baudrate<sp/></highlight></codeline>
<codeline lineno="1001"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>to<sp/>encoded<sp/>divisor<sp/>and<sp/>the<sp/>achievable<sp/>baudrate</highlight></codeline>
<codeline lineno="1002"><highlight class="comment"><sp/><sp/><sp/><sp/>Function<sp/>is<sp/>only<sp/>used<sp/>internally</highlight></codeline>
<codeline lineno="1003"><highlight class="comment"><sp/><sp/><sp/><sp/>\internal</highlight></codeline>
<codeline lineno="1004"><highlight class="comment"></highlight></codeline>
<codeline lineno="1005"><highlight class="comment"><sp/><sp/><sp/><sp/>See<sp/>AN120</highlight></codeline>
<codeline lineno="1006"><highlight class="comment"><sp/><sp/><sp/>clk/1<sp/><sp/><sp/>-&gt;<sp/>0</highlight></codeline>
<codeline lineno="1007"><highlight class="comment"><sp/><sp/><sp/>clk/1.5<sp/>-&gt;<sp/>1</highlight></codeline>
<codeline lineno="1008"><highlight class="comment"><sp/><sp/><sp/>clk/2<sp/><sp/><sp/>-&gt;<sp/>2</highlight></codeline>
<codeline lineno="1009"><highlight class="comment"><sp/><sp/><sp/>From<sp/>/2,<sp/>0.125/<sp/>0.25<sp/>and<sp/>0.5<sp/>steps<sp/>may<sp/>be<sp/>taken</highlight></codeline>
<codeline lineno="1010"><highlight class="comment"><sp/><sp/><sp/>The<sp/>fractional<sp/>part<sp/>has<sp/>frac_code<sp/>encoding</highlight></codeline>
<codeline lineno="1011"><highlight class="comment">*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1012"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ftdi_to_clkbits_AM(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>baudrate,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>*encoded_divisor)</highlight></codeline>
<codeline lineno="1013"><highlight class="normal"></highlight></codeline>
<codeline lineno="1014"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1015"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>frac_code[8]<sp/>=<sp/>{0,<sp/>3,<sp/>2,<sp/>4,<sp/>1,<sp/>5,<sp/>6,<sp/>7};</highlight></codeline>
<codeline lineno="1016"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>am_adjust_up[8]<sp/>=<sp/>{0,<sp/>0,<sp/>0,<sp/>1,<sp/>0,<sp/>3,<sp/>2,<sp/>1};</highlight></codeline>
<codeline lineno="1017"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>am_adjust_dn[8]<sp/>=<sp/>{0,<sp/>0,<sp/>0,<sp/>1,<sp/>0,<sp/>1,<sp/>2,<sp/>3};</highlight></codeline>
<codeline lineno="1018"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>divisor,<sp/>best_divisor,<sp/>best_baud,<sp/>best_baud_diff;</highlight></codeline>
<codeline lineno="1019"><highlight class="normal"><sp/><sp/><sp/><sp/>divisor<sp/>=<sp/>24000000<sp/>/<sp/>baudrate;</highlight></codeline>
<codeline lineno="1020"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="1021"><highlight class="normal"></highlight></codeline>
<codeline lineno="1022"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Round<sp/>down<sp/>to<sp/>supported<sp/>fraction<sp/>(AM<sp/>only)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1023"><highlight class="normal"><sp/><sp/><sp/><sp/>divisor<sp/>-=<sp/>am_adjust_dn[divisor<sp/>&amp;<sp/>7];</highlight></codeline>
<codeline lineno="1024"><highlight class="normal"></highlight></codeline>
<codeline lineno="1025"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Try<sp/>this<sp/>divisor<sp/>and<sp/>the<sp/>one<sp/>above<sp/>it<sp/>(because<sp/>division<sp/>rounds<sp/>down)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1026"><highlight class="normal"><sp/><sp/><sp/><sp/>best_divisor<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1027"><highlight class="normal"><sp/><sp/><sp/><sp/>best_baud<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1028"><highlight class="normal"><sp/><sp/><sp/><sp/>best_baud_diff<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1029"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>2;<sp/>i++)</highlight></codeline>
<codeline lineno="1030"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1031"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>try_divisor<sp/>=<sp/>divisor<sp/>+<sp/>i;</highlight></codeline>
<codeline lineno="1032"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>baud_estimate;</highlight></codeline>
<codeline lineno="1033"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>baud_diff;</highlight></codeline>
<codeline lineno="1034"><highlight class="normal"></highlight></codeline>
<codeline lineno="1035"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Round<sp/>up<sp/>to<sp/>supported<sp/>divisor<sp/>value</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1036"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(try_divisor<sp/>&lt;=<sp/>8)</highlight></codeline>
<codeline lineno="1037"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1038"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Round<sp/>up<sp/>to<sp/>minimum<sp/>supported<sp/>divisor</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1039"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>try_divisor<sp/>=<sp/>8;</highlight></codeline>
<codeline lineno="1040"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1041"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(divisor<sp/>&lt;<sp/>16)</highlight></codeline>
<codeline lineno="1042"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1043"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>AM<sp/>doesn&apos;t<sp/>support<sp/>divisors<sp/>9<sp/>through<sp/>15<sp/>inclusive</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1044"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>try_divisor<sp/>=<sp/>16;</highlight></codeline>
<codeline lineno="1045"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1046"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1047"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1048"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Round<sp/>up<sp/>to<sp/>supported<sp/>fraction<sp/>(AM<sp/>only)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1049"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>try_divisor<sp/>+=<sp/>am_adjust_up[try_divisor<sp/>&amp;<sp/>7];</highlight></codeline>
<codeline lineno="1050"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(try_divisor<sp/>&gt;<sp/>0x1FFF8)</highlight></codeline>
<codeline lineno="1051"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1052"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Round<sp/>down<sp/>to<sp/>maximum<sp/>supported<sp/>divisor<sp/>value<sp/>(for<sp/>AM)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1053"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>try_divisor<sp/>=<sp/>0x1FFF8;</highlight></codeline>
<codeline lineno="1054"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1055"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1056"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Get<sp/>estimated<sp/>baud<sp/>rate<sp/>(to<sp/>nearest<sp/>integer)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1057"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>baud_estimate<sp/>=<sp/>(24000000<sp/>+<sp/>(try_divisor<sp/>/<sp/>2))<sp/>/<sp/>try_divisor;</highlight></codeline>
<codeline lineno="1058"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Get<sp/>absolute<sp/>difference<sp/>from<sp/>requested<sp/>baud<sp/>rate</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1059"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(baud_estimate<sp/>&lt;<sp/>baudrate)</highlight></codeline>
<codeline lineno="1060"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1061"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>baud_diff<sp/>=<sp/>baudrate<sp/>-<sp/>baud_estimate;</highlight></codeline>
<codeline lineno="1062"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1063"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1064"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1065"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>baud_diff<sp/>=<sp/>baud_estimate<sp/>-<sp/>baudrate;</highlight></codeline>
<codeline lineno="1066"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1067"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(i<sp/>==<sp/>0<sp/>||<sp/>baud_diff<sp/>&lt;<sp/>best_baud_diff)</highlight></codeline>
<codeline lineno="1068"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1069"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Closest<sp/>to<sp/>requested<sp/>baud<sp/>rate<sp/>so<sp/>far</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1070"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_divisor<sp/>=<sp/>try_divisor;</highlight></codeline>
<codeline lineno="1071"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_baud<sp/>=<sp/>baud_estimate;</highlight></codeline>
<codeline lineno="1072"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_baud_diff<sp/>=<sp/>baud_diff;</highlight></codeline>
<codeline lineno="1073"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(baud_diff<sp/>==<sp/>0)</highlight></codeline>
<codeline lineno="1074"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1075"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Spot<sp/>on!<sp/>No<sp/>point<sp/>trying</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1076"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1077"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1078"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1079"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1080"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Encode<sp/>the<sp/>best<sp/>divisor<sp/>value</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1081"><highlight class="normal"><sp/><sp/><sp/><sp/>*encoded_divisor<sp/>=<sp/>(best_divisor<sp/>&gt;&gt;<sp/>3)<sp/>|<sp/>(frac_code[best_divisor<sp/>&amp;<sp/>7]<sp/>&lt;&lt;<sp/>14);</highlight></codeline>
<codeline lineno="1082"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Deal<sp/>with<sp/>special<sp/>cases<sp/>for<sp/>encoded<sp/>value</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1083"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*encoded_divisor<sp/>==<sp/>1)</highlight></codeline>
<codeline lineno="1084"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1085"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*encoded_divisor<sp/>=<sp/>0;<sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>3000000<sp/>baud</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1086"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1087"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*encoded_divisor<sp/>==<sp/>0x4001)</highlight></codeline>
<codeline lineno="1088"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1089"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*encoded_divisor<sp/>=<sp/>1;<sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>2000000<sp/>baud<sp/>(BM<sp/>only)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1090"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1091"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>best_baud;</highlight></codeline>
<codeline lineno="1092"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1093"><highlight class="normal"></highlight></codeline>
<codeline lineno="1094"><highlight class="normal"></highlight><highlight class="comment">/*<sp/><sp/>ftdi_to_clkbits<sp/>Convert<sp/>a<sp/>requested<sp/>baudrate<sp/>for<sp/>a<sp/>given<sp/>system<sp/>clock<sp/><sp/>and<sp/>predivisor</highlight></codeline>
<codeline lineno="1095"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>to<sp/>encoded<sp/>divisor<sp/>and<sp/>the<sp/>achievable<sp/>baudrate</highlight></codeline>
<codeline lineno="1096"><highlight class="comment"><sp/><sp/><sp/><sp/>Function<sp/>is<sp/>only<sp/>used<sp/>internally</highlight></codeline>
<codeline lineno="1097"><highlight class="comment"><sp/><sp/><sp/><sp/>\internal</highlight></codeline>
<codeline lineno="1098"><highlight class="comment"></highlight></codeline>
<codeline lineno="1099"><highlight class="comment"><sp/><sp/><sp/><sp/>See<sp/>AN120</highlight></codeline>
<codeline lineno="1100"><highlight class="comment"><sp/><sp/><sp/>clk/1<sp/><sp/><sp/>-&gt;<sp/>0</highlight></codeline>
<codeline lineno="1101"><highlight class="comment"><sp/><sp/><sp/>clk/1.5<sp/>-&gt;<sp/>1</highlight></codeline>
<codeline lineno="1102"><highlight class="comment"><sp/><sp/><sp/>clk/2<sp/><sp/><sp/>-&gt;<sp/>2</highlight></codeline>
<codeline lineno="1103"><highlight class="comment"><sp/><sp/><sp/>From<sp/>/2,<sp/>0.125<sp/>steps<sp/>may<sp/>be<sp/>taken.</highlight></codeline>
<codeline lineno="1104"><highlight class="comment"><sp/><sp/><sp/>The<sp/>fractional<sp/>part<sp/>has<sp/>frac_code<sp/>encoding</highlight></codeline>
<codeline lineno="1105"><highlight class="comment"></highlight></codeline>
<codeline lineno="1106"><highlight class="comment"><sp/><sp/><sp/>value[13:0]<sp/>of<sp/>value<sp/>is<sp/>the<sp/>divisor</highlight></codeline>
<codeline lineno="1107"><highlight class="comment"><sp/><sp/><sp/>index[9]<sp/>mean<sp/>12<sp/>MHz<sp/>Base(120<sp/>MHz/10)<sp/>rate<sp/>versus<sp/>3<sp/>MHz<sp/>(48<sp/>MHz/16)<sp/>else</highlight></codeline>
<codeline lineno="1108"><highlight class="comment"></highlight></codeline>
<codeline lineno="1109"><highlight class="comment"><sp/><sp/><sp/>H<sp/>Type<sp/>have<sp/>all<sp/>features<sp/>above<sp/>with</highlight></codeline>
<codeline lineno="1110"><highlight class="comment"><sp/><sp/><sp/>{index[8],value[15:14]}<sp/>is<sp/>the<sp/>encoded<sp/>subdivisor</highlight></codeline>
<codeline lineno="1111"><highlight class="comment"></highlight></codeline>
<codeline lineno="1112"><highlight class="comment"><sp/><sp/><sp/>FT232R,<sp/>FT2232<sp/>and<sp/>FT232BM<sp/>have<sp/>no<sp/>option<sp/>for<sp/>12<sp/>MHz<sp/>and<sp/>with<sp/></highlight></codeline>
<codeline lineno="1113"><highlight class="comment"><sp/><sp/><sp/>{index[0],value[15:14]}<sp/>is<sp/>the<sp/>encoded<sp/>subdivisor</highlight></codeline>
<codeline lineno="1114"><highlight class="comment"></highlight></codeline>
<codeline lineno="1115"><highlight class="comment"><sp/><sp/><sp/>AM<sp/>Type<sp/>chips<sp/>have<sp/>only<sp/>four<sp/>fractional<sp/>subdivisors<sp/>at<sp/>value[15:14]</highlight></codeline>
<codeline lineno="1116"><highlight class="comment"><sp/><sp/><sp/>for<sp/>subdivisors<sp/>0,<sp/>0.5,<sp/>0.25,<sp/>0.125</highlight></codeline>
<codeline lineno="1117"><highlight class="comment">*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1118"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ftdi_to_clkbits(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>baudrate,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>clk,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>clk_div,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>*encoded_divisor)</highlight></codeline>
<codeline lineno="1119"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1120"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>frac_code[8]<sp/>=<sp/>{0,<sp/>3,<sp/>2,<sp/>4,<sp/>1,<sp/>5,<sp/>6,<sp/>7};</highlight></codeline>
<codeline lineno="1121"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>best_baud<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1122"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>divisor,<sp/>best_divisor;</highlight></codeline>
<codeline lineno="1123"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(baudrate<sp/>&gt;=<sp/><sp/>clk/clk_div)</highlight></codeline>
<codeline lineno="1124"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*encoded_divisor<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_baud<sp/>=<sp/>clk/clk_div;</highlight></codeline>
<codeline lineno="1127"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1128"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(baudrate<sp/>&gt;=<sp/><sp/>clk/(clk_div<sp/>+<sp/>clk_div/2))</highlight></codeline>
<codeline lineno="1129"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*encoded_divisor<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="1131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_baud<sp/>=<sp/>clk/(clk_div<sp/>+<sp/>clk_div/2);</highlight></codeline>
<codeline lineno="1132"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1133"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(baudrate<sp/>&gt;=<sp/><sp/>clk/(2*clk_div))</highlight></codeline>
<codeline lineno="1134"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*encoded_divisor<sp/>=<sp/>2;</highlight></codeline>
<codeline lineno="1136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_baud<sp/>=<sp/>clk/(2*clk_div);</highlight></codeline>
<codeline lineno="1137"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1138"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1139"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>We<sp/>divide<sp/>by<sp/>16<sp/>to<sp/>have<sp/>3<sp/>fractional<sp/>bits<sp/>and<sp/>one<sp/>bit<sp/>for<sp/>rounding<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>divisor<sp/>=<sp/>clk*16/clk_div<sp/>/<sp/>baudrate;</highlight></codeline>
<codeline lineno="1142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(divisor<sp/>&amp;<sp/>1)<sp/></highlight><highlight class="comment">/*<sp/>Decide<sp/>if<sp/>to<sp/>round<sp/>up<sp/>or<sp/>down*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_divisor<sp/>=<sp/>divisor<sp/>/2<sp/>+1;</highlight></codeline>
<codeline lineno="1144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_divisor<sp/>=<sp/>divisor/2;</highlight></codeline>
<codeline lineno="1146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(best_divisor<sp/>&gt;<sp/>0x20000)</highlight></codeline>
<codeline lineno="1147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_divisor<sp/>=<sp/>0x1ffff;</highlight></codeline>
<codeline lineno="1148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_baud<sp/>=<sp/>clk*16/clk_div/best_divisor;</highlight></codeline>
<codeline lineno="1149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(best_baud<sp/>&amp;<sp/>1)<sp/></highlight><highlight class="comment">/*<sp/>Decide<sp/>if<sp/>to<sp/>round<sp/>up<sp/>or<sp/>down*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_baud<sp/>=<sp/>best_baud<sp/>/2<sp/>+1;</highlight></codeline>
<codeline lineno="1151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_baud<sp/>=<sp/>best_baud<sp/>/2;</highlight></codeline>
<codeline lineno="1153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*encoded_divisor<sp/>=<sp/>(best_divisor<sp/>&gt;&gt;<sp/>3)<sp/>|<sp/>(frac_code[best_divisor<sp/>&amp;<sp/>0x7]<sp/>&lt;&lt;<sp/>14);</highlight></codeline>
<codeline lineno="1154"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1155"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>best_baud;</highlight></codeline>
<codeline lineno="1156"><highlight class="normal">}<sp/></highlight></codeline>
<codeline lineno="1162"><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ftdi_convert_baudrate(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>baudrate,<sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,</highlight></codeline>
<codeline lineno="1163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>*value,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>*index)</highlight></codeline>
<codeline lineno="1164"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1165"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>best_baud;</highlight></codeline>
<codeline lineno="1166"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>encoded_divisor;</highlight></codeline>
<codeline lineno="1167"><highlight class="normal"></highlight></codeline>
<codeline lineno="1168"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(baudrate<sp/>&lt;=<sp/>0)</highlight></codeline>
<codeline lineno="1169"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Return<sp/>error</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="1172"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1173"><highlight class="normal"></highlight></codeline>
<codeline lineno="1174"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>H_CLK<sp/>120000000</highlight></codeline>
<codeline lineno="1175"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>C_CLK<sp/><sp/>48000000</highlight></codeline>
<codeline lineno="1176"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>)<sp/>||<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref>)<sp/>||<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref><sp/>))</highlight></codeline>
<codeline lineno="1177"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1178"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(baudrate*10<sp/>&gt;<sp/>H_CLK<sp/>/0x3fff)</highlight></codeline>
<codeline lineno="1179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>On<sp/>H<sp/>Devices,<sp/>use<sp/>12<sp/>000<sp/>000<sp/>Baudrate<sp/>when<sp/>possible</highlight></codeline>
<codeline lineno="1181"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>We<sp/>have<sp/>a<sp/>14<sp/>bit<sp/>divisor,<sp/>a<sp/>1<sp/>bit<sp/>divisor<sp/>switch<sp/>(10<sp/>or<sp/>16)<sp/></highlight></codeline>
<codeline lineno="1182"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>three<sp/>fractional<sp/>bits<sp/>and<sp/>a<sp/>120<sp/>MHz<sp/>clock</highlight></codeline>
<codeline lineno="1183"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Assume<sp/>AN_120<sp/>&quot;Sub-integer<sp/>divisors<sp/>between<sp/>0<sp/>and<sp/>2<sp/>are<sp/>not<sp/>allowed&quot;<sp/>holds<sp/>for</highlight></codeline>
<codeline lineno="1184"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>DIV/10<sp/>CLK<sp/>too,<sp/>so<sp/>/1,<sp/>/1.5<sp/>and<sp/>/2<sp/>can<sp/>be<sp/>handled<sp/>the<sp/>same*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1185"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_baud<sp/>=<sp/>ftdi_to_clkbits(baudrate,<sp/>H_CLK,<sp/>10,<sp/>&amp;encoded_divisor);</highlight></codeline>
<codeline lineno="1186"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>encoded_divisor<sp/>|=<sp/>0x20000;<sp/></highlight><highlight class="comment">/*<sp/>switch<sp/>on<sp/>CLK/10*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1187"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1188"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1189"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_baud<sp/>=<sp/>ftdi_to_clkbits(baudrate,<sp/>C_CLK,<sp/>16,<sp/>&amp;encoded_divisor);</highlight></codeline>
<codeline lineno="1190"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1191"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>)<sp/>||<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>)<sp/>||<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref><sp/>))</highlight></codeline>
<codeline lineno="1192"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_baud<sp/>=<sp/>ftdi_to_clkbits(baudrate,<sp/>C_CLK,<sp/>16,<sp/>&amp;encoded_divisor);</highlight></codeline>
<codeline lineno="1194"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1195"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1196"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>best_baud<sp/>=<sp/>ftdi_to_clkbits_AM(baudrate,<sp/>&amp;encoded_divisor);</highlight></codeline>
<codeline lineno="1198"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1199"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Split<sp/>into<sp/>&quot;value&quot;<sp/>and<sp/>&quot;index&quot;<sp/>values</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1200"><highlight class="normal"><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/>short)(encoded_divisor<sp/>&amp;<sp/>0xFFFF);</highlight></codeline>
<codeline lineno="1201"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref><sp/>||<sp/></highlight></codeline>
<codeline lineno="1202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref><sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref><sp/>)</highlight></codeline>
<codeline lineno="1203"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1204"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*index<sp/>=<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/>short)(encoded_divisor<sp/>&gt;&gt;<sp/>8);</highlight></codeline>
<codeline lineno="1205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*index<sp/>&amp;=<sp/>0xFF00;</highlight></codeline>
<codeline lineno="1206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*index<sp/>|=<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>;</highlight></codeline>
<codeline lineno="1207"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1208"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1209"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*index<sp/>=<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/>short)(encoded_divisor<sp/>&gt;&gt;<sp/>16);</highlight></codeline>
<codeline lineno="1210"><highlight class="normal"></highlight></codeline>
<codeline lineno="1211"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Return<sp/>the<sp/>nearest<sp/>baud<sp/>rate</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1212"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>best_baud;</highlight></codeline>
<codeline lineno="1213"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1214"><highlight class="normal"></highlight></codeline>
<codeline lineno="1219" refid="group__libftdi_1ga90fbdaa0bbee4c6d0d0ccd7225b2c843" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga90fbdaa0bbee4c6d0d0ccd7225b2c843" kindref="member" tooltip="Wrapper function to export ftdi_convert_baudrate() to the unit test Do not use, it&amp;#39;s only for the uni...">convert_baudrate_UT_export</ref>(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>baudrate,<sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,</highlight></codeline>
<codeline lineno="1220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>*value,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>*index)</highlight></codeline>
<codeline lineno="1221"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1222"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ftdi_convert_baudrate(baudrate,<sp/>ftdi,<sp/>value,<sp/>index);</highlight></codeline>
<codeline lineno="1223"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1224"><highlight class="normal"></highlight></codeline>
<codeline lineno="1236" refid="group__libftdi_1gae80f1dc38f5c80946a56ec34a329e7f5" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gae80f1dc38f5c80946a56ec34a329e7f5" kindref="member">ftdi_set_baudrate</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>baudrate)</highlight></codeline>
<codeline lineno="1237"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1238"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>value,<sp/>index;</highlight></codeline>
<codeline lineno="1239"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>actual_baudrate;</highlight></codeline>
<codeline lineno="1240"><highlight class="normal"></highlight></codeline>
<codeline lineno="1241"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1242"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1243"><highlight class="normal"></highlight></codeline>
<codeline lineno="1244"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a164c17ee7bddaa0d76da8da7138f602f" kindref="member">bitbang_enabled</ref>)</highlight></codeline>
<codeline lineno="1245"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>baudrate<sp/>=<sp/>baudrate*4;</highlight></codeline>
<codeline lineno="1247"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1248"><highlight class="normal"></highlight></codeline>
<codeline lineno="1249"><highlight class="normal"><sp/><sp/><sp/><sp/>actual_baudrate<sp/>=<sp/>ftdi_convert_baudrate(baudrate,<sp/>ftdi,<sp/>&amp;value,<sp/>&amp;index);</highlight></codeline>
<codeline lineno="1250"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(actual_baudrate<sp/>&lt;=<sp/>0)</highlight></codeline>
<codeline lineno="1251"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref><sp/>(-1,<sp/></highlight><highlight class="stringliteral">&quot;Silly<sp/>baudrate<sp/>&lt;=<sp/>0.&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1252"><highlight class="normal"></highlight></codeline>
<codeline lineno="1253"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Check<sp/>within<sp/>tolerance<sp/>(about<sp/>5%)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1254"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((actual_baudrate<sp/>*<sp/>2<sp/>&lt;<sp/>baudrate<sp/></highlight><highlight class="comment">/*<sp/>Catch<sp/>overflows<sp/>*/</highlight><highlight class="normal"><sp/>)</highlight></codeline>
<codeline lineno="1255"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>||<sp/>((actual_baudrate<sp/>&lt;<sp/>baudrate)</highlight></codeline>
<codeline lineno="1256"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>?<sp/>(actual_baudrate<sp/>*<sp/>21<sp/>&lt;<sp/>baudrate<sp/>*<sp/>20)</highlight></codeline>
<codeline lineno="1257"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>:<sp/>(baudrate<sp/>*<sp/>21<sp/>&lt;<sp/>actual_baudrate<sp/>*<sp/>20)))</highlight></codeline>
<codeline lineno="1258"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref><sp/>(-1,<sp/></highlight><highlight class="stringliteral">&quot;Unsupported<sp/>baudrate.<sp/>Note:<sp/>bitbang<sp/>baudrates<sp/>are<sp/>automatically<sp/>multiplied<sp/>by<sp/>4&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1259"><highlight class="normal"></highlight></codeline>
<codeline lineno="1260"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,</highlight></codeline>
<codeline lineno="1261"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ftdi_8h_1a92906a42c77f2165392071ae422fc068" kindref="member">SIO_SET_BAUDRATE_REQUEST</ref>,<sp/>value,</highlight></codeline>
<codeline lineno="1262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>index,<sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="1263"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref><sp/>(-2,<sp/></highlight><highlight class="stringliteral">&quot;Setting<sp/>new<sp/>baudrate<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1264"><highlight class="normal"></highlight></codeline>
<codeline lineno="1265"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aa688eb2312af3a9fb6b56a8c59178e34" kindref="member">baudrate</ref><sp/>=<sp/>baudrate;</highlight></codeline>
<codeline lineno="1266"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="1267"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1268"><highlight class="normal"></highlight></codeline>
<codeline lineno="1282" refid="group__libftdi_1ga044fdde91eaa3f557b545172622ee460" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga044fdde91eaa3f557b545172622ee460" kindref="member">ftdi_set_line_property</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a8007a7d5e37b76307c341051769e5c6f" kindref="member">ftdi_bits_type</ref><sp/>bits,</highlight></codeline>
<codeline lineno="1283"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a3977a883c99069e02f97e99d059dc8b8" kindref="member">ftdi_stopbits_type</ref><sp/>sbit,<sp/></highlight><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1d" kindref="member">ftdi_parity_type</ref><sp/>parity)</highlight></codeline>
<codeline lineno="1284"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1285"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga481d055a35dd9042c1c23e2214d2655c" kindref="member">ftdi_set_line_property2</ref>(ftdi,<sp/>bits,<sp/>sbit,<sp/>parity,<sp/><ref refid="ftdi_8h_1ae1ca6c6246df33380443c4ba6f192025a17b671576ab0f99edd941019303ce7a4" kindref="member">BREAK_OFF</ref>);</highlight></codeline>
<codeline lineno="1286"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1287"><highlight class="normal"></highlight></codeline>
<codeline lineno="1301" refid="group__libftdi_1ga481d055a35dd9042c1c23e2214d2655c" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga481d055a35dd9042c1c23e2214d2655c" kindref="member">ftdi_set_line_property2</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a8007a7d5e37b76307c341051769e5c6f" kindref="member">ftdi_bits_type</ref><sp/>bits,</highlight></codeline>
<codeline lineno="1302"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a3977a883c99069e02f97e99d059dc8b8" kindref="member">ftdi_stopbits_type</ref><sp/>sbit,<sp/></highlight><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1d" kindref="member">ftdi_parity_type</ref><sp/>parity,</highlight></codeline>
<codeline lineno="1303"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ae1ca6c6246df33380443c4ba6f192025" kindref="member">ftdi_break_type</ref><sp/>break_type)</highlight></codeline>
<codeline lineno="1304"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1305"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>value<sp/>=<sp/>bits;</highlight></codeline>
<codeline lineno="1306"><highlight class="normal"></highlight></codeline>
<codeline lineno="1307"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1308"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1309"><highlight class="normal"></highlight></codeline>
<codeline lineno="1310"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(parity)</highlight></codeline>
<codeline lineno="1311"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1312"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1dac157bdf0b85a40d2619cbc8bc1ae5fe2" kindref="member">NONE</ref>:</highlight></codeline>
<codeline lineno="1313"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>|=<sp/>(0x00<sp/>&lt;&lt;<sp/>8);</highlight></codeline>
<codeline lineno="1314"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1315"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1daa29cedab858353a26006af9db7cd1ed8" kindref="member">ODD</ref>:</highlight></codeline>
<codeline lineno="1316"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>|=<sp/>(0x01<sp/>&lt;&lt;<sp/>8);</highlight></codeline>
<codeline lineno="1317"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1318"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1da8487756fbc720579906f0ae1738f0fcc" kindref="member">EVEN</ref>:</highlight></codeline>
<codeline lineno="1319"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>|=<sp/>(0x02<sp/>&lt;&lt;<sp/>8);</highlight></codeline>
<codeline lineno="1320"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1321"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1dab2a979177fd509f5398ec69341f7058f" kindref="member">MARK</ref>:</highlight></codeline>
<codeline lineno="1322"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>|=<sp/>(0x03<sp/>&lt;&lt;<sp/>8);</highlight></codeline>
<codeline lineno="1323"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1324"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ab0a93b5355c5155dd4fbd5beaf5d5e1dac08dae7edcb5c5bb959fee5971fbad95" kindref="member">SPACE</ref>:</highlight></codeline>
<codeline lineno="1325"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>|=<sp/>(0x04<sp/>&lt;&lt;<sp/>8);</highlight></codeline>
<codeline lineno="1326"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1327"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1328"><highlight class="normal"></highlight></codeline>
<codeline lineno="1329"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(sbit)</highlight></codeline>
<codeline lineno="1330"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1331"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a3977a883c99069e02f97e99d059dc8b8a706ed2f39ef4e69314ec3cda847d47f9" kindref="member">STOP_BIT_1</ref>:</highlight></codeline>
<codeline lineno="1332"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>|=<sp/>(0x00<sp/>&lt;&lt;<sp/>11);</highlight></codeline>
<codeline lineno="1333"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1334"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a3977a883c99069e02f97e99d059dc8b8abe0eab9d50a866c950d3cae314e772ba" kindref="member">STOP_BIT_15</ref>:</highlight></codeline>
<codeline lineno="1335"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>|=<sp/>(0x01<sp/>&lt;&lt;<sp/>11);</highlight></codeline>
<codeline lineno="1336"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1337"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a3977a883c99069e02f97e99d059dc8b8a9f707b03d4db34dd2d5f346f5ca590c6" kindref="member">STOP_BIT_2</ref>:</highlight></codeline>
<codeline lineno="1338"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>|=<sp/>(0x02<sp/>&lt;&lt;<sp/>11);</highlight></codeline>
<codeline lineno="1339"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1340"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1341"><highlight class="normal"></highlight></codeline>
<codeline lineno="1342"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(break_type)</highlight></codeline>
<codeline lineno="1343"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1344"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ae1ca6c6246df33380443c4ba6f192025a17b671576ab0f99edd941019303ce7a4" kindref="member">BREAK_OFF</ref>:</highlight></codeline>
<codeline lineno="1345"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>|=<sp/>(0x00<sp/>&lt;&lt;<sp/>14);</highlight></codeline>
<codeline lineno="1346"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1347"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ae1ca6c6246df33380443c4ba6f192025acf4ae3922d90ced9c3c6c4d48c3ef2e3" kindref="member">BREAK_ON</ref>:</highlight></codeline>
<codeline lineno="1348"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>|=<sp/>(0x01<sp/>&lt;&lt;<sp/>14);</highlight></codeline>
<codeline lineno="1349"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1350"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1351"><highlight class="normal"></highlight></codeline>
<codeline lineno="1352"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,</highlight></codeline>
<codeline lineno="1353"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ftdi_8h_1a3060d361931e004cae4880164192c4ae" kindref="member">SIO_SET_DATA_REQUEST</ref>,<sp/>value,</highlight></codeline>
<codeline lineno="1354"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,<sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="1355"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref><sp/>(-1,<sp/></highlight><highlight class="stringliteral">&quot;Setting<sp/>new<sp/>line<sp/>property<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1356"><highlight class="normal"></highlight></codeline>
<codeline lineno="1357"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="1358"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1359"><highlight class="normal"></highlight></codeline>
<codeline lineno="1371" refid="group__libftdi_1gaa79550f209ce3327a5df03f2bd1e80f0" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gaa79550f209ce3327a5df03f2bd1e80f0" kindref="member">ftdi_write_data</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*buf,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>size)</highlight></codeline>
<codeline lineno="1372"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1373"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>offset<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1374"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>actual_length;</highlight></codeline>
<codeline lineno="1375"><highlight class="normal"></highlight></codeline>
<codeline lineno="1376"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1377"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-666,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1378"><highlight class="normal"></highlight></codeline>
<codeline lineno="1379"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(offset<sp/>&lt;<sp/>size)</highlight></codeline>
<codeline lineno="1380"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1381"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>write_size<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a127d66a8b7602bd767fb01ce90e2a6be" kindref="member">writebuffer_chunksize</ref>;</highlight></codeline>
<codeline lineno="1382"><highlight class="normal"></highlight></codeline>
<codeline lineno="1383"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(offset+write_size<sp/>&gt;<sp/>size)</highlight></codeline>
<codeline lineno="1384"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>write_size<sp/>=<sp/>size-offset;</highlight></codeline>
<codeline lineno="1385"><highlight class="normal"></highlight></codeline>
<codeline lineno="1386"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_bulk_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a9b6cfd3763a3ca80c76bc52c89dad968" kindref="member">in_ep</ref>,<sp/>buf+offset,<sp/>write_size,<sp/>&amp;actual_length,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="1387"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;usb<sp/>bulk<sp/>write<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1388"><highlight class="normal"></highlight></codeline>
<codeline lineno="1389"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>offset<sp/>+=<sp/>actual_length;</highlight></codeline>
<codeline lineno="1390"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1391"><highlight class="normal"></highlight></codeline>
<codeline lineno="1392"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>offset;</highlight></codeline>
<codeline lineno="1393"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1394"><highlight class="normal"></highlight></codeline>
<codeline lineno="1395"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>ftdi_read_data_cb(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/>libusb_transfer<sp/>*transfer)</highlight></codeline>
<codeline lineno="1396"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1397"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref><sp/>*tc<sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref><sp/>*)<sp/>transfer-&gt;user_data;</highlight></codeline>
<codeline lineno="1398"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi<sp/>=<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a2df8400982dc8214f00852dec0f5f4a0" kindref="member">ftdi</ref>;</highlight></codeline>
<codeline lineno="1399"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>packet_size,<sp/>actual_length,<sp/>num_of_chunks,<sp/>chunk_remains,<sp/>i,<sp/>ret;</highlight></codeline>
<codeline lineno="1400"><highlight class="normal"></highlight></codeline>
<codeline lineno="1401"><highlight class="normal"><sp/><sp/><sp/><sp/>packet_size<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a7ca2f7e68cd28e1c3079d029fd6129c0" kindref="member">max_packet_size</ref>;</highlight></codeline>
<codeline lineno="1402"><highlight class="normal"></highlight></codeline>
<codeline lineno="1403"><highlight class="normal"><sp/><sp/><sp/><sp/>actual_length<sp/>=<sp/>transfer-&gt;actual_length;</highlight></codeline>
<codeline lineno="1404"><highlight class="normal"></highlight></codeline>
<codeline lineno="1405"><highlight class="normal"><sp/><sp/><sp/><sp/>if<sp/>(actual_length<sp/>&gt;<sp/>2)</highlight></codeline>
<codeline lineno="1406"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1407"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>skip<sp/>FTDI<sp/>status<sp/>bytes.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1408"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Maybe<sp/>stored<sp/>in<sp/>the<sp/>future<sp/>to<sp/>enable<sp/>modem<sp/>use</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1409"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>num_of_chunks<sp/>=<sp/>actual_length<sp/>/<sp/>packet_size;</highlight></codeline>
<codeline lineno="1410"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>chunk_remains<sp/>=<sp/>actual_length<sp/>%<sp/>packet_size;</highlight></codeline>
<codeline lineno="1411"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//printf(&quot;actual_length<sp/>=<sp/>%X,<sp/>num_of_chunks<sp/>=<sp/>%X,<sp/>chunk_remains<sp/>=<sp/>%X,<sp/>readbuffer_offset<sp/>=<sp/>%X\n&quot;,<sp/>actual_length,<sp/>num_of_chunks,<sp/>chunk_remains,<sp/>ftdi-&gt;readbuffer_offset);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1412"><highlight class="normal"></highlight></codeline>
<codeline lineno="1413"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>+=<sp/>2;</highlight></codeline>
<codeline lineno="1414"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>actual_length<sp/>-=<sp/>2;</highlight></codeline>
<codeline lineno="1415"><highlight class="normal"></highlight></codeline>
<codeline lineno="1416"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(actual_length<sp/>&gt;<sp/>packet_size<sp/>-<sp/>2)</highlight></codeline>
<codeline lineno="1417"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1418"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>1;<sp/>i<sp/>&lt;<sp/>num_of_chunks;<sp/>i++)</highlight></codeline>
<codeline lineno="1419"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memmove<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>+(packet_size<sp/>-<sp/>2)*i,</highlight></codeline>
<codeline lineno="1420"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>+packet_size*i,</highlight></codeline>
<codeline lineno="1421"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>packet_size<sp/>-<sp/>2);</highlight></codeline>
<codeline lineno="1422"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(chunk_remains<sp/>&gt;<sp/>2)</highlight></codeline>
<codeline lineno="1423"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1424"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memmove<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>+(packet_size<sp/>-<sp/>2)*i,</highlight></codeline>
<codeline lineno="1425"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>+packet_size*i,</highlight></codeline>
<codeline lineno="1426"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>chunk_remains-2);</highlight></codeline>
<codeline lineno="1427"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>actual_length<sp/>-=<sp/>2*num_of_chunks;</highlight></codeline>
<codeline lineno="1428"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1429"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1430"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>actual_length<sp/>-=<sp/>2*(num_of_chunks-1)+chunk_remains;</highlight></codeline>
<codeline lineno="1431"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1432"><highlight class="normal"></highlight></codeline>
<codeline lineno="1433"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(actual_length<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="1434"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1435"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>data<sp/>still<sp/>fits<sp/>in<sp/>buf?</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1436"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref><sp/>+<sp/>actual_length<sp/>&lt;=<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>)</highlight></codeline>
<codeline lineno="1437"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1438"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memcpy<sp/>(tc-&gt;<ref refid="structftdi__transfer__control_1a2667c871dacd0a472f778e4d08c5dfe5" kindref="member">buf</ref><sp/>+<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref><sp/>+<sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>,<sp/>actual_length);</highlight></codeline>
<codeline lineno="1439"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//printf(&quot;buf[0]<sp/>=<sp/>%X,<sp/>buf[1]<sp/>=<sp/>%X\n&quot;,<sp/>buf[0],<sp/>buf[1]);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1440"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref><sp/>+=<sp/>actual_length;</highlight></codeline>
<codeline lineno="1441"><highlight class="normal"></highlight></codeline>
<codeline lineno="1442"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1443"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1444"><highlight class="normal"></highlight></codeline>
<codeline lineno="1445"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Did<sp/>we<sp/>read<sp/>exactly<sp/>the<sp/>right<sp/>amount<sp/>of<sp/>bytes?<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1446"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref><sp/>==<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>)</highlight></codeline>
<codeline lineno="1447"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1448"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//printf(&quot;read_data<sp/>exact<sp/>rem<sp/>%d<sp/>offset<sp/>%d\n&quot;,</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1449"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//ftdi-&gt;readbuffer_remaining,<sp/>offset);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1450"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" kindref="member">completed</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="1451"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1452"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1453"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1454"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1455"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1456"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>only<sp/>copy<sp/>part<sp/>of<sp/>the<sp/>data<sp/>or<sp/>size<sp/>&lt;=<sp/>readbuffer_chunksize</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1457"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>part_size<sp/>=<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref><sp/>-<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref>;</highlight></codeline>
<codeline lineno="1458"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memcpy<sp/>(tc-&gt;<ref refid="structftdi__transfer__control_1a2667c871dacd0a472f778e4d08c5dfe5" kindref="member">buf</ref><sp/>+<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref><sp/>+<sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>,<sp/>part_size);</highlight></codeline>
<codeline lineno="1459"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref><sp/>+=<sp/>part_size;</highlight></codeline>
<codeline lineno="1460"><highlight class="normal"></highlight></codeline>
<codeline lineno="1461"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>+=<sp/>part_size;</highlight></codeline>
<codeline lineno="1462"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>=<sp/>actual_length<sp/>-<sp/>part_size;</highlight></codeline>
<codeline lineno="1463"><highlight class="normal"></highlight></codeline>
<codeline lineno="1464"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>printf(&quot;Returning<sp/>part:<sp/>%d<sp/>-<sp/>size:<sp/>%d<sp/>-<sp/>offset:<sp/>%d<sp/>-<sp/>actual_length:<sp/>%d<sp/>-<sp/>remaining:<sp/>%d\n&quot;,</highlight></codeline>
<codeline lineno="1465"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>part_size,<sp/>size,<sp/>offset,<sp/>actual_length,<sp/>ftdi-&gt;readbuffer_remaining);<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1466"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" kindref="member">completed</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="1467"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1468"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1469"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1470"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1471"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>libusb_submit_transfer<sp/>(transfer);</highlight></codeline>
<codeline lineno="1472"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="1473"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" kindref="member">completed</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="1474"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1475"><highlight class="normal"></highlight></codeline>
<codeline lineno="1476"><highlight class="normal"></highlight></codeline>
<codeline lineno="1477"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>ftdi_write_data_cb(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/>libusb_transfer<sp/>*transfer)</highlight></codeline>
<codeline lineno="1478"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1479"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref><sp/>*tc<sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref><sp/>*)<sp/>transfer-&gt;user_data;</highlight></codeline>
<codeline lineno="1480"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi<sp/>=<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a2df8400982dc8214f00852dec0f5f4a0" kindref="member">ftdi</ref>;</highlight></codeline>
<codeline lineno="1481"><highlight class="normal"></highlight></codeline>
<codeline lineno="1482"><highlight class="normal"><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref><sp/>+=<sp/>transfer-&gt;actual_length;</highlight></codeline>
<codeline lineno="1483"><highlight class="normal"></highlight></codeline>
<codeline lineno="1484"><highlight class="normal"><sp/><sp/><sp/><sp/>if<sp/>(tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref><sp/>==<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>)</highlight></codeline>
<codeline lineno="1485"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1486"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" kindref="member">completed</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="1487"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1488"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1489"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1490"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>write_size<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a127d66a8b7602bd767fb01ce90e2a6be" kindref="member">writebuffer_chunksize</ref>;</highlight></codeline>
<codeline lineno="1491"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="1492"><highlight class="normal"></highlight></codeline>
<codeline lineno="1493"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref><sp/>+<sp/>write_size<sp/>&gt;<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>)</highlight></codeline>
<codeline lineno="1494"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>write_size<sp/>=<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref><sp/>-<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref>;</highlight></codeline>
<codeline lineno="1495"><highlight class="normal"></highlight></codeline>
<codeline lineno="1496"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>transfer-&gt;length<sp/>=<sp/>write_size;</highlight></codeline>
<codeline lineno="1497"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>transfer-&gt;buffer<sp/>=<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a2667c871dacd0a472f778e4d08c5dfe5" kindref="member">buf</ref><sp/>+<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref>;</highlight></codeline>
<codeline lineno="1498"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>libusb_submit_transfer<sp/>(transfer);</highlight></codeline>
<codeline lineno="1499"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="1500"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" kindref="member">completed</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="1501"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1502"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1503"><highlight class="normal"></highlight></codeline>
<codeline lineno="1504"><highlight class="normal"></highlight></codeline>
<codeline lineno="1519" refid="group__libftdi_1ga90c2133a195fc7ebf229205c2755fc67" refkind="member"><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref><sp/>*<ref refid="group__libftdi_1ga90c2133a195fc7ebf229205c2755fc67" kindref="member">ftdi_write_data_submit</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<ref refid="structftdi__transfer__control_1a2667c871dacd0a472f778e4d08c5dfe5" kindref="member">buf</ref>,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>)</highlight></codeline>
<codeline lineno="1520"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1521"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref><sp/>*tc;</highlight></codeline>
<codeline lineno="1522"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">libusb_transfer<sp/>*transfer;</highlight></codeline>
<codeline lineno="1523"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>write_size,<sp/>ret;</highlight></codeline>
<codeline lineno="1524"><highlight class="normal"></highlight></codeline>
<codeline lineno="1525"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1526"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>NULL;</highlight></codeline>
<codeline lineno="1527"><highlight class="normal"></highlight></codeline>
<codeline lineno="1528"><highlight class="normal"><sp/><sp/><sp/><sp/>tc<sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref><sp/>*)<sp/>malloc<sp/>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal"><sp/>(*tc));</highlight></codeline>
<codeline lineno="1529"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!tc)</highlight></codeline>
<codeline lineno="1530"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>NULL;</highlight></codeline>
<codeline lineno="1531"><highlight class="normal"></highlight></codeline>
<codeline lineno="1532"><highlight class="normal"><sp/><sp/><sp/><sp/>transfer<sp/>=<sp/>libusb_alloc_transfer(0);</highlight></codeline>
<codeline lineno="1533"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!transfer)</highlight></codeline>
<codeline lineno="1534"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1535"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(tc);</highlight></codeline>
<codeline lineno="1536"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>NULL;</highlight></codeline>
<codeline lineno="1537"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1538"><highlight class="normal"></highlight></codeline>
<codeline lineno="1539"><highlight class="normal"><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a2df8400982dc8214f00852dec0f5f4a0" kindref="member">ftdi</ref><sp/>=<sp/><ref refid="structftdi__transfer__control_1a2df8400982dc8214f00852dec0f5f4a0" kindref="member">ftdi</ref>;</highlight></codeline>
<codeline lineno="1540"><highlight class="normal"><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" kindref="member">completed</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1541"><highlight class="normal"><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a2667c871dacd0a472f778e4d08c5dfe5" kindref="member">buf</ref><sp/>=<sp/><ref refid="structftdi__transfer__control_1a2667c871dacd0a472f778e4d08c5dfe5" kindref="member">buf</ref>;</highlight></codeline>
<codeline lineno="1542"><highlight class="normal"><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref><sp/>=<sp/><ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>;</highlight></codeline>
<codeline lineno="1543"><highlight class="normal"><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1544"><highlight class="normal"></highlight></codeline>
<codeline lineno="1545"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(size<sp/>&lt;<sp/>ftdi-&gt;writebuffer_chunksize)</highlight></codeline>
<codeline lineno="1546"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>write_size<sp/>=<sp/><ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>;</highlight></codeline>
<codeline lineno="1547"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1548"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>write_size<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a127d66a8b7602bd767fb01ce90e2a6be" kindref="member">writebuffer_chunksize</ref>;</highlight></codeline>
<codeline lineno="1549"><highlight class="normal"></highlight></codeline>
<codeline lineno="1550"><highlight class="normal"><sp/><sp/><sp/><sp/>libusb_fill_bulk_transfer(transfer,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a9b6cfd3763a3ca80c76bc52c89dad968" kindref="member">in_ep</ref>,<sp/>buf,</highlight></codeline>
<codeline lineno="1551"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>write_size,<sp/>ftdi_write_data_cb,<sp/>tc,</highlight></codeline>
<codeline lineno="1552"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>);</highlight></codeline>
<codeline lineno="1553"><highlight class="normal"><sp/><sp/><sp/><sp/>transfer-&gt;type<sp/>=<sp/>LIBUSB_TRANSFER_TYPE_BULK;</highlight></codeline>
<codeline lineno="1554"><highlight class="normal"></highlight></codeline>
<codeline lineno="1555"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>libusb_submit_transfer(transfer);</highlight></codeline>
<codeline lineno="1556"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="1557"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1558"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_free_transfer(transfer);</highlight></codeline>
<codeline lineno="1559"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(tc);</highlight></codeline>
<codeline lineno="1560"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>NULL;</highlight></codeline>
<codeline lineno="1561"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1562"><highlight class="normal"><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" kindref="member">transfer</ref><sp/>=<sp/><ref refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" kindref="member">transfer</ref>;</highlight></codeline>
<codeline lineno="1563"><highlight class="normal"></highlight></codeline>
<codeline lineno="1564"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>tc;</highlight></codeline>
<codeline lineno="1565"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1566"><highlight class="normal"></highlight></codeline>
<codeline lineno="1581" refid="group__libftdi_1gab4dd69a3332c544dfdcbf4da85bd8801" refkind="member"><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref><sp/>*<ref refid="group__libftdi_1gab4dd69a3332c544dfdcbf4da85bd8801" kindref="member">ftdi_read_data_submit</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<ref refid="structftdi__transfer__control_1a2667c871dacd0a472f778e4d08c5dfe5" kindref="member">buf</ref>,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>)</highlight></codeline>
<codeline lineno="1582"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1583"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref><sp/>*tc;</highlight></codeline>
<codeline lineno="1584"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">libusb_transfer<sp/>*transfer;</highlight></codeline>
<codeline lineno="1585"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="1586"><highlight class="normal"></highlight></codeline>
<codeline lineno="1587"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1588"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>NULL;</highlight></codeline>
<codeline lineno="1589"><highlight class="normal"></highlight></codeline>
<codeline lineno="1590"><highlight class="normal"><sp/><sp/><sp/><sp/>tc<sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref><sp/>*)<sp/>malloc<sp/>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal"><sp/>(*tc));</highlight></codeline>
<codeline lineno="1591"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!tc)</highlight></codeline>
<codeline lineno="1592"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>NULL;</highlight></codeline>
<codeline lineno="1593"><highlight class="normal"></highlight></codeline>
<codeline lineno="1594"><highlight class="normal"><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a2df8400982dc8214f00852dec0f5f4a0" kindref="member">ftdi</ref><sp/>=<sp/><ref refid="structftdi__transfer__control_1a2df8400982dc8214f00852dec0f5f4a0" kindref="member">ftdi</ref>;</highlight></codeline>
<codeline lineno="1595"><highlight class="normal"><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a2667c871dacd0a472f778e4d08c5dfe5" kindref="member">buf</ref><sp/>=<sp/><ref refid="structftdi__transfer__control_1a2667c871dacd0a472f778e4d08c5dfe5" kindref="member">buf</ref>;</highlight></codeline>
<codeline lineno="1596"><highlight class="normal"><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref><sp/>=<sp/><ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>;</highlight></codeline>
<codeline lineno="1597"><highlight class="normal"></highlight></codeline>
<codeline lineno="1598"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(size<sp/>&lt;=<sp/>ftdi-&gt;readbuffer_remaining)</highlight></codeline>
<codeline lineno="1599"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1600"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memcpy<sp/>(buf,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>,<sp/>size);</highlight></codeline>
<codeline lineno="1601"><highlight class="normal"></highlight></codeline>
<codeline lineno="1602"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Fix<sp/>offsets</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1603"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>-=<sp/><ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>;</highlight></codeline>
<codeline lineno="1604"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>+=<sp/><ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>;</highlight></codeline>
<codeline lineno="1605"><highlight class="normal"></highlight></codeline>
<codeline lineno="1606"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>printf(&quot;Returning<sp/>bytes<sp/>from<sp/>buffer:<sp/>%d<sp/>-<sp/>remaining:<sp/>%d\n&quot;,<sp/>size,<sp/>ftdi-&gt;readbuffer_remaining);<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1607"><highlight class="normal"></highlight></codeline>
<codeline lineno="1608"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" kindref="member">completed</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="1609"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref><sp/>=<sp/><ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>;</highlight></codeline>
<codeline lineno="1610"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" kindref="member">transfer</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="1611"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>tc;</highlight></codeline>
<codeline lineno="1612"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1613"><highlight class="normal"></highlight></codeline>
<codeline lineno="1614"><highlight class="normal"><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" kindref="member">completed</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1615"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="1616"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1617"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memcpy<sp/>(buf,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref>);</highlight></codeline>
<codeline lineno="1618"><highlight class="normal"></highlight></codeline>
<codeline lineno="1619"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref><sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref>;</highlight></codeline>
<codeline lineno="1620"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1621"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1622"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1623"><highlight class="normal"></highlight></codeline>
<codeline lineno="1624"><highlight class="normal"><sp/><sp/><sp/><sp/>transfer<sp/>=<sp/>libusb_alloc_transfer(0);</highlight></codeline>
<codeline lineno="1625"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!transfer)</highlight></codeline>
<codeline lineno="1626"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1627"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free<sp/>(tc);</highlight></codeline>
<codeline lineno="1628"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>NULL;</highlight></codeline>
<codeline lineno="1629"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1630"><highlight class="normal"></highlight></codeline>
<codeline lineno="1631"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1632"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1633"><highlight class="normal"></highlight></codeline>
<codeline lineno="1634"><highlight class="normal"><sp/><sp/><sp/><sp/>libusb_fill_bulk_transfer(transfer,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a079427d8f2c09102bcadb9118e60c0ec" kindref="member">out_ep</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a8bd3ab7267621b4a8ec3f08ae18b1c00" kindref="member">readbuffer_chunksize</ref>,<sp/>ftdi_read_data_cb,<sp/>tc,<sp/>ftdi-&gt;<ref refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" kindref="member">usb_read_timeout</ref>);</highlight></codeline>
<codeline lineno="1635"><highlight class="normal"><sp/><sp/><sp/><sp/>transfer-&gt;type<sp/>=<sp/>LIBUSB_TRANSFER_TYPE_BULK;</highlight></codeline>
<codeline lineno="1636"><highlight class="normal"></highlight></codeline>
<codeline lineno="1637"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>libusb_submit_transfer(transfer);</highlight></codeline>
<codeline lineno="1638"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="1639"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1640"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_free_transfer(transfer);</highlight></codeline>
<codeline lineno="1641"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free<sp/>(tc);</highlight></codeline>
<codeline lineno="1642"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>NULL;</highlight></codeline>
<codeline lineno="1643"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1644"><highlight class="normal"><sp/><sp/><sp/><sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" kindref="member">transfer</ref><sp/>=<sp/><ref refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" kindref="member">transfer</ref>;</highlight></codeline>
<codeline lineno="1645"><highlight class="normal"></highlight></codeline>
<codeline lineno="1646"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>tc;</highlight></codeline>
<codeline lineno="1647"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1648"><highlight class="normal"></highlight></codeline>
<codeline lineno="1660" refid="group__libftdi_1gaf580b6263d15746d1f5d3759f9c3ac02" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gaf580b6263d15746d1f5d3759f9c3ac02" kindref="member">ftdi_transfer_data_done</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__transfer__control" kindref="compound">ftdi_transfer_control</ref><sp/>*tc)</highlight></codeline>
<codeline lineno="1661"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1662"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="1663"><highlight class="normal"></highlight></codeline>
<codeline lineno="1664"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(!tc-&gt;<ref refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" kindref="member">completed</ref>)</highlight></codeline>
<codeline lineno="1665"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1666"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>libusb_handle_events(tc-&gt;<ref refid="structftdi__transfer__control_1a2df8400982dc8214f00852dec0f5f4a0" kindref="member">ftdi</ref>-&gt;<ref refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" kindref="member">usb_ctx</ref>);</highlight></codeline>
<codeline lineno="1667"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="1668"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1669"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>==<sp/>LIBUSB_ERROR_INTERRUPTED)</highlight></codeline>
<codeline lineno="1670"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">continue</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1671"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_cancel_transfer(tc-&gt;<ref refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" kindref="member">transfer</ref>);</highlight></codeline>
<codeline lineno="1672"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(!tc-&gt;<ref refid="structftdi__transfer__control_1af904524e85aed9f5f04e386c3cee3724" kindref="member">completed</ref>)</highlight></codeline>
<codeline lineno="1673"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_handle_events(tc-&gt;<ref refid="structftdi__transfer__control_1a2df8400982dc8214f00852dec0f5f4a0" kindref="member">ftdi</ref>-&gt;<ref refid="structftdi__context_1a05bd064e6608ee91b641eff379455e9f" kindref="member">usb_ctx</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="1674"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="1675"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_free_transfer(tc-&gt;<ref refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" kindref="member">transfer</ref>);</highlight></codeline>
<codeline lineno="1676"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free<sp/>(tc);</highlight></codeline>
<codeline lineno="1677"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="1678"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1679"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1680"><highlight class="normal"></highlight></codeline>
<codeline lineno="1681"><highlight class="normal"><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>tc-&gt;<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref>;</highlight></codeline>
<codeline lineno="1686"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tc-&gt;<ref refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" kindref="member">transfer</ref>)</highlight></codeline>
<codeline lineno="1687"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1688"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tc-&gt;<ref refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" kindref="member">transfer</ref>-&gt;status<sp/>!=<sp/>LIBUSB_TRANSFER_COMPLETED)</highlight></codeline>
<codeline lineno="1689"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="1690"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>libusb_free_transfer(tc-&gt;<ref refid="structftdi__transfer__control_1a1619679c2e823f10b12f5b63e49c0b7c" kindref="member">transfer</ref>);</highlight></codeline>
<codeline lineno="1691"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1692"><highlight class="normal"><sp/><sp/><sp/><sp/>free(tc);</highlight></codeline>
<codeline lineno="1693"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="1694"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1695"><highlight class="normal"></highlight></codeline>
<codeline lineno="1706" refid="group__libftdi_1ga85e22717c3315a09219b03a1862c0c46" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga85e22717c3315a09219b03a1862c0c46" kindref="member">ftdi_write_data_set_chunksize</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>chunksize)</highlight></codeline>
<codeline lineno="1707"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1708"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1709"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;ftdi<sp/>context<sp/>invalid&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1710"><highlight class="normal"></highlight></codeline>
<codeline lineno="1711"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a127d66a8b7602bd767fb01ce90e2a6be" kindref="member">writebuffer_chunksize</ref><sp/>=<sp/>chunksize;</highlight></codeline>
<codeline lineno="1712"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="1713"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1714"><highlight class="normal"></highlight></codeline>
<codeline lineno="1724" refid="group__libftdi_1ga5944f14ffd11faa113515ff29dc769ed" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga5944f14ffd11faa113515ff29dc769ed" kindref="member">ftdi_write_data_get_chunksize</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*chunksize)</highlight></codeline>
<codeline lineno="1725"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1726"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1727"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;ftdi<sp/>context<sp/>invalid&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1728"><highlight class="normal"></highlight></codeline>
<codeline lineno="1729"><highlight class="normal"><sp/><sp/><sp/><sp/>*chunksize<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a127d66a8b7602bd767fb01ce90e2a6be" kindref="member">writebuffer_chunksize</ref>;</highlight></codeline>
<codeline lineno="1730"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="1731"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1732"><highlight class="normal"></highlight></codeline>
<codeline lineno="1748" refid="group__libftdi_1ga72d87e30015c98bd0be22e7c8c873345" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga72d87e30015c98bd0be22e7c8c873345" kindref="member">ftdi_read_data</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<ref refid="structftdi__transfer__control_1a2667c871dacd0a472f778e4d08c5dfe5" kindref="member">buf</ref>,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>)</highlight></codeline>
<codeline lineno="1749"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1750"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref><sp/>=<sp/>0,<sp/>ret,<sp/>i,<sp/>num_of_chunks,<sp/>chunk_remains;</highlight></codeline>
<codeline lineno="1751"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>packet_size<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a7ca2f7e68cd28e1c3079d029fd6129c0" kindref="member">max_packet_size</ref>;</highlight></codeline>
<codeline lineno="1752"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>actual_length<sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="1753"><highlight class="normal"></highlight></codeline>
<codeline lineno="1754"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1755"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-666,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1756"><highlight class="normal"></highlight></codeline>
<codeline lineno="1757"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Packet<sp/>size<sp/>sanity<sp/>check<sp/>(avoid<sp/>division<sp/>by<sp/>zero)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1758"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(packet_size<sp/>==<sp/>0)</highlight></codeline>
<codeline lineno="1759"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;max_packet_size<sp/>is<sp/>bogus<sp/>(zero)&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1760"><highlight class="normal"></highlight></codeline>
<codeline lineno="1761"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>everything<sp/>we<sp/>want<sp/>is<sp/>still<sp/>in<sp/>the<sp/>readbuffer?</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1762"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(size<sp/>&lt;=<sp/>ftdi-&gt;readbuffer_remaining)</highlight></codeline>
<codeline lineno="1763"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1764"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memcpy<sp/>(buf,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>,<sp/>size);</highlight></codeline>
<codeline lineno="1765"><highlight class="normal"></highlight></codeline>
<codeline lineno="1766"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Fix<sp/>offsets</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1767"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>-=<sp/><ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>;</highlight></codeline>
<codeline lineno="1768"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>+=<sp/><ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>;</highlight></codeline>
<codeline lineno="1769"><highlight class="normal"></highlight></codeline>
<codeline lineno="1770"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>printf(&quot;Returning<sp/>bytes<sp/>from<sp/>buffer:<sp/>%d<sp/>-<sp/>remaining:<sp/>%d\n&quot;,<sp/>size,<sp/>ftdi-&gt;readbuffer_remaining);<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1771"><highlight class="normal"></highlight></codeline>
<codeline lineno="1772"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="structftdi__transfer__control_1a019bd69018bb3c15dd75b258e6928af2" kindref="member">size</ref>;</highlight></codeline>
<codeline lineno="1773"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1774"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>something<sp/>still<sp/>in<sp/>the<sp/>readbuffer,<sp/>but<sp/>not<sp/>enough<sp/>to<sp/>satisfy<sp/>&apos;size&apos;?</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1775"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="1776"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1777"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memcpy<sp/>(buf,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref>);</highlight></codeline>
<codeline lineno="1778"><highlight class="normal"></highlight></codeline>
<codeline lineno="1779"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Fix<sp/>offset</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1780"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>offset<sp/>+=<sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref>;</highlight></codeline>
<codeline lineno="1781"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1782"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>do<sp/>the<sp/>actual<sp/>USB<sp/>read</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1783"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(offset<sp/>&lt;<sp/>size<sp/>&amp;&amp;<sp/>actual_length<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="1784"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1785"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1786"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1787"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>returns<sp/>how<sp/>much<sp/>received<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1788"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ret<sp/>=<sp/>libusb_bulk_transfer<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a079427d8f2c09102bcadb9118e60c0ec" kindref="member">out_ep</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a8bd3ab7267621b4a8ec3f08ae18b1c00" kindref="member">readbuffer_chunksize</ref>,<sp/>&amp;actual_length,<sp/>ftdi-&gt;<ref refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" kindref="member">usb_read_timeout</ref>);</highlight></codeline>
<codeline lineno="1789"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ret<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="1790"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(ret,<sp/></highlight><highlight class="stringliteral">&quot;usb<sp/>bulk<sp/>read<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1791"><highlight class="normal"></highlight></codeline>
<codeline lineno="1792"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(actual_length<sp/>&gt;<sp/>2)</highlight></codeline>
<codeline lineno="1793"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1794"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>skip<sp/>FTDI<sp/>status<sp/>bytes.</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1795"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Maybe<sp/>stored<sp/>in<sp/>the<sp/>future<sp/>to<sp/>enable<sp/>modem<sp/>use</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1796"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>num_of_chunks<sp/>=<sp/>actual_length<sp/>/<sp/>packet_size;</highlight></codeline>
<codeline lineno="1797"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>chunk_remains<sp/>=<sp/>actual_length<sp/>%<sp/>packet_size;</highlight></codeline>
<codeline lineno="1798"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//printf(&quot;actual_length<sp/>=<sp/>%X,<sp/>num_of_chunks<sp/>=<sp/>%X,<sp/>chunk_remains<sp/>=<sp/>%X,<sp/>readbuffer_offset<sp/>=<sp/>%X\n&quot;,<sp/>actual_length,<sp/>num_of_chunks,<sp/>chunk_remains,<sp/>ftdi-&gt;readbuffer_offset);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1799"><highlight class="normal"></highlight></codeline>
<codeline lineno="1800"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>+=<sp/>2;</highlight></codeline>
<codeline lineno="1801"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>actual_length<sp/>-=<sp/>2;</highlight></codeline>
<codeline lineno="1802"><highlight class="normal"></highlight></codeline>
<codeline lineno="1803"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(actual_length<sp/>&gt;<sp/>packet_size<sp/>-<sp/>2)</highlight></codeline>
<codeline lineno="1804"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1805"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>1;<sp/>i<sp/>&lt;<sp/>num_of_chunks;<sp/>i++)</highlight></codeline>
<codeline lineno="1806"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memmove<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>+(packet_size<sp/>-<sp/>2)*i,</highlight></codeline>
<codeline lineno="1807"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>+packet_size*i,</highlight></codeline>
<codeline lineno="1808"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>packet_size<sp/>-<sp/>2);</highlight></codeline>
<codeline lineno="1809"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(chunk_remains<sp/>&gt;<sp/>2)</highlight></codeline>
<codeline lineno="1810"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1811"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memmove<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>+(packet_size<sp/>-<sp/>2)*i,</highlight></codeline>
<codeline lineno="1812"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>+packet_size*i,</highlight></codeline>
<codeline lineno="1813"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>chunk_remains-2);</highlight></codeline>
<codeline lineno="1814"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>actual_length<sp/>-=<sp/>2*num_of_chunks;</highlight></codeline>
<codeline lineno="1815"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1816"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1817"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>actual_length<sp/>-=<sp/>2*(num_of_chunks-1)+chunk_remains;</highlight></codeline>
<codeline lineno="1818"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1819"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1820"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(actual_length<sp/>&lt;=<sp/>2)</highlight></codeline>
<codeline lineno="1821"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1822"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>no<sp/>more<sp/>data<sp/>to<sp/>read?</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1823"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref>;</highlight></codeline>
<codeline lineno="1824"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1825"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(actual_length<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="1826"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1827"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>data<sp/>still<sp/>fits<sp/>in<sp/>buf?</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1828"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(offset+actual_length<sp/>&lt;=<sp/>size)</highlight></codeline>
<codeline lineno="1829"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1830"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memcpy<sp/>(buf+offset,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>,<sp/>actual_length);</highlight></codeline>
<codeline lineno="1831"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//printf(&quot;buf[0]<sp/>=<sp/>%X,<sp/>buf[1]<sp/>=<sp/>%X\n&quot;,<sp/>buf[0],<sp/>buf[1]);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1832"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>offset<sp/>+=<sp/>actual_length;</highlight></codeline>
<codeline lineno="1833"><highlight class="normal"></highlight></codeline>
<codeline lineno="1834"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Did<sp/>we<sp/>read<sp/>exactly<sp/>the<sp/>right<sp/>amount<sp/>of<sp/>bytes?<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1835"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(offset<sp/>==<sp/>size)</highlight></codeline>
<codeline lineno="1836"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//printf(&quot;read_data<sp/>exact<sp/>rem<sp/>%d<sp/>offset<sp/>%d\n&quot;,</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1837"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//ftdi-&gt;readbuffer_remaining,<sp/>offset);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1838"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref>;</highlight></codeline>
<codeline lineno="1839"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1840"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1841"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="1842"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>only<sp/>copy<sp/>part<sp/>of<sp/>the<sp/>data<sp/>or<sp/>size<sp/>&lt;=<sp/>readbuffer_chunksize</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1843"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>part_size<sp/>=<sp/>size-<ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref>;</highlight></codeline>
<codeline lineno="1844"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>memcpy<sp/>(buf+offset,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>+ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref>,<sp/>part_size);</highlight></codeline>
<codeline lineno="1845"><highlight class="normal"></highlight></codeline>
<codeline lineno="1846"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>+=<sp/>part_size;</highlight></codeline>
<codeline lineno="1847"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>=<sp/>actual_length-part_size;</highlight></codeline>
<codeline lineno="1848"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>offset<sp/>+=<sp/>part_size;</highlight></codeline>
<codeline lineno="1849"><highlight class="normal"></highlight></codeline>
<codeline lineno="1850"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>printf(&quot;Returning<sp/>part:<sp/>%d<sp/>-<sp/>size:<sp/>%d<sp/>-<sp/>offset:<sp/>%d<sp/>-<sp/>actual_length:<sp/>%d<sp/>-<sp/>remaining:<sp/>%d\n&quot;,</highlight></codeline>
<codeline lineno="1851"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>part_size,<sp/>size,<sp/>offset,<sp/>actual_length,<sp/>ftdi-&gt;readbuffer_remaining);<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1852"><highlight class="normal"></highlight></codeline>
<codeline lineno="1853"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="structftdi__transfer__control_1a26a718dd0866c73947f173886d462a8a" kindref="member">offset</ref>;</highlight></codeline>
<codeline lineno="1854"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1855"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1856"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="1857"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>never<sp/>reached</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1858"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-127;</highlight></codeline>
<codeline lineno="1859"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1860"><highlight class="normal"></highlight></codeline>
<codeline lineno="1873" refid="group__libftdi_1ga65783703baf0828d519ef597bb2855c1" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga65783703baf0828d519ef597bb2855c1" kindref="member">ftdi_read_data_set_chunksize</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>chunksize)</highlight></codeline>
<codeline lineno="1874"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1875"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*new_buf;</highlight></codeline>
<codeline lineno="1876"><highlight class="normal"></highlight></codeline>
<codeline lineno="1877"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1878"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;ftdi<sp/>context<sp/>invalid&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1879"><highlight class="normal"></highlight></codeline>
<codeline lineno="1880"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Invalidate<sp/>all<sp/>remaining<sp/>data</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1881"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aca6046c8ee0175acf84334afab5a3392" kindref="member">readbuffer_offset</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1882"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1aad05935e91af93e8dbe36781217632bf" kindref="member">readbuffer_remaining</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1883"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>__linux__</highlight></codeline>
<codeline lineno="1884"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>We<sp/>can&apos;t<sp/>set<sp/>readbuffer_chunksize<sp/>larger<sp/>than<sp/>MAX_BULK_BUFFER_LENGTH,</highlight></codeline>
<codeline lineno="1885"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>which<sp/>is<sp/>defined<sp/>in<sp/>libusb-1.0.<sp/><sp/>Otherwise,<sp/>each<sp/>USB<sp/>read<sp/>request<sp/>will</highlight></codeline>
<codeline lineno="1886"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>be<sp/>divided<sp/>into<sp/>multiple<sp/>URBs.<sp/><sp/>This<sp/>will<sp/>cause<sp/>issues<sp/>on<sp/>Linux<sp/>kernel</highlight></codeline>
<codeline lineno="1887"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>older<sp/>than<sp/>2.6.32.<sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1888"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(chunksize<sp/>&gt;<sp/>16384)</highlight></codeline>
<codeline lineno="1889"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>chunksize<sp/>=<sp/>16384;</highlight></codeline>
<codeline lineno="1890"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight></codeline>
<codeline lineno="1891"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1892"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((new_buf<sp/>=<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)realloc(ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref>,<sp/>chunksize))<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1893"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;out<sp/>of<sp/>memory<sp/>for<sp/>readbuffer&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1894"><highlight class="normal"></highlight></codeline>
<codeline lineno="1895"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a891754b08145eee8669598ab28c985a4" kindref="member">readbuffer</ref><sp/>=<sp/>new_buf;</highlight></codeline>
<codeline lineno="1896"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a8bd3ab7267621b4a8ec3f08ae18b1c00" kindref="member">readbuffer_chunksize</ref><sp/>=<sp/>chunksize;</highlight></codeline>
<codeline lineno="1897"><highlight class="normal"></highlight></codeline>
<codeline lineno="1898"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="1899"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1900"><highlight class="normal"></highlight></codeline>
<codeline lineno="1910" refid="group__libftdi_1gab42b05f26b6a6545ae3ae1b4edc28e5c" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gab42b05f26b6a6545ae3ae1b4edc28e5c" kindref="member">ftdi_read_data_get_chunksize</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*chunksize)</highlight></codeline>
<codeline lineno="1911"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1912"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1913"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;FTDI<sp/>context<sp/>invalid&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1914"><highlight class="normal"></highlight></codeline>
<codeline lineno="1915"><highlight class="normal"><sp/><sp/><sp/><sp/>*chunksize<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a8bd3ab7267621b4a8ec3f08ae18b1c00" kindref="member">readbuffer_chunksize</ref>;</highlight></codeline>
<codeline lineno="1916"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="1917"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1918"><highlight class="normal"></highlight></codeline>
<codeline lineno="1931" refid="group__libftdi_1ga83b41e900a1faf2ecc0546ce48ec7e70" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga83b41e900a1faf2ecc0546ce48ec7e70" kindref="member">ftdi_set_bitmode</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>bitmask,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>mode)</highlight></codeline>
<codeline lineno="1932"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1933"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>usb_val;</highlight></codeline>
<codeline lineno="1934"><highlight class="normal"></highlight></codeline>
<codeline lineno="1935"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1936"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1937"><highlight class="normal"></highlight></codeline>
<codeline lineno="1938"><highlight class="normal"><sp/><sp/><sp/><sp/>usb_val<sp/>=<sp/>bitmask;<sp/></highlight><highlight class="comment">//<sp/>low<sp/>byte:<sp/>bitmask</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="1939"><highlight class="normal"><sp/><sp/><sp/><sp/>usb_val<sp/>|=<sp/>(mode<sp/>&lt;&lt;<sp/>8);</highlight></codeline>
<codeline lineno="1940"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1afe6cb4f5f53d7e21f50479c8847d4d26" kindref="member">SIO_SET_BITMODE_REQUEST</ref>,<sp/>usb_val,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,<sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="1941"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;unable<sp/>to<sp/>configure<sp/>bitbang<sp/>mode.<sp/>Perhaps<sp/>not<sp/>a<sp/>BM/2232C<sp/>type<sp/>chip?&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1942"><highlight class="normal"></highlight></codeline>
<codeline lineno="1943"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a017557435f4377c2353d9d3b7fbcff01" kindref="member">bitbang_mode</ref><sp/>=<sp/>mode;</highlight></codeline>
<codeline lineno="1944"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a164c17ee7bddaa0d76da8da7138f602f" kindref="member">bitbang_enabled</ref><sp/>=<sp/>(mode<sp/>==<sp/><ref refid="ftdi_8h_1a2250f7812c87a96ada7fd4f19b82f666a9a39449cbe4c114e1e6bfa7d699470d0" kindref="member">BITMODE_RESET</ref>)<sp/>?<sp/>0<sp/>:<sp/>1;</highlight></codeline>
<codeline lineno="1945"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="1946"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1947"><highlight class="normal"></highlight></codeline>
<codeline lineno="1957" refid="group__libftdi_1ga42b4776b91c6b14d2d1008b160b78efa" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga42b4776b91c6b14d2d1008b160b78efa" kindref="member">ftdi_disable_bitbang</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="1958"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1959"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1960"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1961"><highlight class="normal"></highlight></codeline>
<codeline lineno="1962"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1afe6cb4f5f53d7e21f50479c8847d4d26" kindref="member">SIO_SET_BITMODE_REQUEST</ref>,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,<sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="1963"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;unable<sp/>to<sp/>leave<sp/>bitbang<sp/>mode.<sp/>Perhaps<sp/>not<sp/>a<sp/>BM<sp/>type<sp/>chip?&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1964"><highlight class="normal"></highlight></codeline>
<codeline lineno="1965"><highlight class="normal"><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a164c17ee7bddaa0d76da8da7138f602f" kindref="member">bitbang_enabled</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="1966"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="1967"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1968"><highlight class="normal"></highlight></codeline>
<codeline lineno="1969"><highlight class="normal"></highlight></codeline>
<codeline lineno="1980" refid="group__libftdi_1gab823dd90f2359612b1546ef0ceebdc0e" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gab823dd90f2359612b1546ef0ceebdc0e" kindref="member">ftdi_read_pins</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*pins)</highlight></codeline>
<codeline lineno="1981"><highlight class="normal">{</highlight></codeline>
<codeline lineno="1982"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="1983"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1984"><highlight class="normal"></highlight></codeline>
<codeline lineno="1985"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" kindref="member">FTDI_DEVICE_IN_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1a6891bba67d5536ca8108a3c5bed01866" kindref="member">SIO_READ_PINS_REQUEST</ref>,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)pins,<sp/>1,<sp/>ftdi-&gt;<ref refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" kindref="member">usb_read_timeout</ref>)<sp/>!=<sp/>1)</highlight></codeline>
<codeline lineno="1986"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;read<sp/>pins<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="1987"><highlight class="normal"></highlight></codeline>
<codeline lineno="1988"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="1989"><highlight class="normal">}</highlight></codeline>
<codeline lineno="1990"><highlight class="normal"></highlight></codeline>
<codeline lineno="2006" refid="group__libftdi_1ga3e0227b0c7aa859d2d2afb5ffa4c8466" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga3e0227b0c7aa859d2d2afb5ffa4c8466" kindref="member">ftdi_set_latency_timer</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>latency)</highlight></codeline>
<codeline lineno="2007"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2008"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>usb_val;</highlight></codeline>
<codeline lineno="2009"><highlight class="normal"></highlight></codeline>
<codeline lineno="2010"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(latency<sp/>&lt;<sp/>1)</highlight></codeline>
<codeline lineno="2011"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;latency<sp/>out<sp/>of<sp/>range.<sp/>Only<sp/>valid<sp/>for<sp/>1-255&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2012"><highlight class="normal"></highlight></codeline>
<codeline lineno="2013"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2014"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2015"><highlight class="normal"></highlight></codeline>
<codeline lineno="2016"><highlight class="normal"><sp/><sp/><sp/><sp/>usb_val<sp/>=<sp/>latency;</highlight></codeline>
<codeline lineno="2017"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1a6a69ccd99fa8f1d77ba9475a69a3256d" kindref="member">SIO_SET_LATENCY_TIMER_REQUEST</ref>,<sp/>usb_val,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,<sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="2018"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;unable<sp/>to<sp/>set<sp/>latency<sp/>timer&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2019"><highlight class="normal"></highlight></codeline>
<codeline lineno="2020"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2021"><highlight class="normal">}</highlight></codeline>
<codeline lineno="2022"><highlight class="normal"></highlight></codeline>
<codeline lineno="2033" refid="group__libftdi_1gacf7b6dcc4de33db2263ce8a421e18bfc" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gacf7b6dcc4de33db2263ce8a421e18bfc" kindref="member">ftdi_get_latency_timer</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*latency)</highlight></codeline>
<codeline lineno="2034"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2035"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>usb_val;</highlight></codeline>
<codeline lineno="2036"><highlight class="normal"></highlight></codeline>
<codeline lineno="2037"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2038"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2039"><highlight class="normal"></highlight></codeline>
<codeline lineno="2040"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" kindref="member">FTDI_DEVICE_IN_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1ad4c92540084ee84c0eead313a7bbe3fa" kindref="member">SIO_GET_LATENCY_TIMER_REQUEST</ref>,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)&amp;usb_val,<sp/>1,<sp/>ftdi-&gt;<ref refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" kindref="member">usb_read_timeout</ref>)<sp/>!=<sp/>1)</highlight></codeline>
<codeline lineno="2041"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;reading<sp/>latency<sp/>timer<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2042"><highlight class="normal"></highlight></codeline>
<codeline lineno="2043"><highlight class="normal"><sp/><sp/><sp/><sp/>*latency<sp/>=<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/>char)usb_val;</highlight></codeline>
<codeline lineno="2044"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2045"><highlight class="normal">}</highlight></codeline>
<codeline lineno="2046"><highlight class="normal"></highlight></codeline>
<codeline lineno="2087" refid="group__libftdi_1ga396c3bf1435fb3317755868e28c47414" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga396c3bf1435fb3317755868e28c47414" kindref="member">ftdi_poll_modem_status</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>*status)</highlight></codeline>
<codeline lineno="2088"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2089"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>usb_val[2];</highlight></codeline>
<codeline lineno="2090"><highlight class="normal"></highlight></codeline>
<codeline lineno="2091"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2092"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2093"><highlight class="normal"></highlight></codeline>
<codeline lineno="2094"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" kindref="member">FTDI_DEVICE_IN_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1aadec0bf6ad89f4fd94d7a5f5a212aa36" kindref="member">SIO_POLL_MODEM_STATUS_REQUEST</ref>,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)usb_val,<sp/>2,<sp/>ftdi-&gt;<ref refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" kindref="member">usb_read_timeout</ref>)<sp/>!=<sp/>2)</highlight></codeline>
<codeline lineno="2095"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;getting<sp/>modem<sp/>status<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2096"><highlight class="normal"></highlight></codeline>
<codeline lineno="2097"><highlight class="normal"><sp/><sp/><sp/><sp/>*status<sp/>=<sp/>(usb_val[1]<sp/>&lt;&lt;<sp/>8)<sp/>|<sp/>(usb_val[0]<sp/>&amp;<sp/>0xFF);</highlight></codeline>
<codeline lineno="2098"><highlight class="normal"></highlight></codeline>
<codeline lineno="2099"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2100"><highlight class="normal">}</highlight></codeline>
<codeline lineno="2101"><highlight class="normal"></highlight></codeline>
<codeline lineno="2113" refid="group__libftdi_1gac3b3d2cc69edf567e653340f434c91e0" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gac3b3d2cc69edf567e653340f434c91e0" kindref="member">ftdi_setflowctrl</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>flowctrl)</highlight></codeline>
<codeline lineno="2114"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2115"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2117"><highlight class="normal"></highlight></codeline>
<codeline lineno="2118"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,</highlight></codeline>
<codeline lineno="2119"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ftdi_8h_1ac1f7891448c392bf8b59a99dd9f0cc8b" kindref="member">SIO_SET_FLOW_CTRL_REQUEST</ref>,<sp/>0,<sp/>(flowctrl<sp/>|<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>),</highlight></codeline>
<codeline lineno="2120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="2121"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;set<sp/>flow<sp/>control<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2122"><highlight class="normal"></highlight></codeline>
<codeline lineno="2123"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2124"><highlight class="normal">}</highlight></codeline>
<codeline lineno="2125"><highlight class="normal"></highlight></codeline>
<codeline lineno="2136" refid="group__libftdi_1ga47761f16762363288c55f5fff24620d5" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga47761f16762363288c55f5fff24620d5" kindref="member">ftdi_setdtr</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>state)</highlight></codeline>
<codeline lineno="2137"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2138"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>usb_val;</highlight></codeline>
<codeline lineno="2139"><highlight class="normal"></highlight></codeline>
<codeline lineno="2140"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2142"><highlight class="normal"></highlight></codeline>
<codeline lineno="2143"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(state)</highlight></codeline>
<codeline lineno="2144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>usb_val<sp/>=<sp/><ref refid="ftdi_8h_1ab93aac18cc98c8601ee233089b1e1874" kindref="member">SIO_SET_DTR_HIGH</ref>;</highlight></codeline>
<codeline lineno="2145"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2146"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>usb_val<sp/>=<sp/><ref refid="ftdi_8h_1a0e7b24544b495e4701640d4ea181e29a" kindref="member">SIO_SET_DTR_LOW</ref>;</highlight></codeline>
<codeline lineno="2147"><highlight class="normal"></highlight></codeline>
<codeline lineno="2148"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,</highlight></codeline>
<codeline lineno="2149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ftdi_8h_1a634bc73352c2a79fdea9ded7e19cd7db" kindref="member">SIO_SET_MODEM_CTRL_REQUEST</ref>,<sp/>usb_val,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,</highlight></codeline>
<codeline lineno="2150"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="2151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;set<sp/>dtr<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2152"><highlight class="normal"></highlight></codeline>
<codeline lineno="2153"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2154"><highlight class="normal">}</highlight></codeline>
<codeline lineno="2155"><highlight class="normal"></highlight></codeline>
<codeline lineno="2166" refid="group__libftdi_1ga5713ba73288b3e1ac1d45096c917c1ab" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga5713ba73288b3e1ac1d45096c917c1ab" kindref="member">ftdi_setrts</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>state)</highlight></codeline>
<codeline lineno="2167"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2168"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>usb_val;</highlight></codeline>
<codeline lineno="2169"><highlight class="normal"></highlight></codeline>
<codeline lineno="2170"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2172"><highlight class="normal"></highlight></codeline>
<codeline lineno="2173"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(state)</highlight></codeline>
<codeline lineno="2174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>usb_val<sp/>=<sp/><ref refid="ftdi_8h_1af2a5be61d404ae9d5283420c8146048d" kindref="member">SIO_SET_RTS_HIGH</ref>;</highlight></codeline>
<codeline lineno="2175"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>usb_val<sp/>=<sp/><ref refid="ftdi_8h_1aca30d9bfc0334b28fcc0ab639c4a6cc5" kindref="member">SIO_SET_RTS_LOW</ref>;</highlight></codeline>
<codeline lineno="2177"><highlight class="normal"></highlight></codeline>
<codeline lineno="2178"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,</highlight></codeline>
<codeline lineno="2179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ftdi_8h_1a634bc73352c2a79fdea9ded7e19cd7db" kindref="member">SIO_SET_MODEM_CTRL_REQUEST</ref>,<sp/>usb_val,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,</highlight></codeline>
<codeline lineno="2180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="2181"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;set<sp/>of<sp/>rts<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2182"><highlight class="normal"></highlight></codeline>
<codeline lineno="2183"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2184"><highlight class="normal">}</highlight></codeline>
<codeline lineno="2185"><highlight class="normal"></highlight></codeline>
<codeline lineno="2197" refid="group__libftdi_1ga5a8f23c2e77c8b58c1f44a11e2f52aa9" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga5a8f23c2e77c8b58c1f44a11e2f52aa9" kindref="member">ftdi_setdtr_rts</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>dtr,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>rts)</highlight></codeline>
<codeline lineno="2198"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2199"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>usb_val;</highlight></codeline>
<codeline lineno="2200"><highlight class="normal"></highlight></codeline>
<codeline lineno="2201"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2203"><highlight class="normal"></highlight></codeline>
<codeline lineno="2204"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(dtr)</highlight></codeline>
<codeline lineno="2205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>usb_val<sp/>=<sp/><ref refid="ftdi_8h_1ab93aac18cc98c8601ee233089b1e1874" kindref="member">SIO_SET_DTR_HIGH</ref>;</highlight></codeline>
<codeline lineno="2206"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>usb_val<sp/>=<sp/><ref refid="ftdi_8h_1a0e7b24544b495e4701640d4ea181e29a" kindref="member">SIO_SET_DTR_LOW</ref>;</highlight></codeline>
<codeline lineno="2208"><highlight class="normal"></highlight></codeline>
<codeline lineno="2209"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(rts)</highlight></codeline>
<codeline lineno="2210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>usb_val<sp/>|=<sp/><ref refid="ftdi_8h_1af2a5be61d404ae9d5283420c8146048d" kindref="member">SIO_SET_RTS_HIGH</ref>;</highlight></codeline>
<codeline lineno="2211"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2212"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>usb_val<sp/>|=<sp/><ref refid="ftdi_8h_1aca30d9bfc0334b28fcc0ab639c4a6cc5" kindref="member">SIO_SET_RTS_LOW</ref>;</highlight></codeline>
<codeline lineno="2213"><highlight class="normal"></highlight></codeline>
<codeline lineno="2214"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,</highlight></codeline>
<codeline lineno="2215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ftdi_8h_1a634bc73352c2a79fdea9ded7e19cd7db" kindref="member">SIO_SET_MODEM_CTRL_REQUEST</ref>,<sp/>usb_val,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,</highlight></codeline>
<codeline lineno="2216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="2217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;set<sp/>of<sp/>rts/dtr<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2218"><highlight class="normal"></highlight></codeline>
<codeline lineno="2219"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2220"><highlight class="normal">}</highlight></codeline>
<codeline lineno="2221"><highlight class="normal"></highlight></codeline>
<codeline lineno="2233" refid="group__libftdi_1ga71eeabe2ee5474d5c0ceddc2e08766cd" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga71eeabe2ee5474d5c0ceddc2e08766cd" kindref="member">ftdi_set_event_char</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,</highlight></codeline>
<codeline lineno="2234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>eventch,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>enable)</highlight></codeline>
<codeline lineno="2235"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2236"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>usb_val;</highlight></codeline>
<codeline lineno="2237"><highlight class="normal"></highlight></codeline>
<codeline lineno="2238"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2240"><highlight class="normal"></highlight></codeline>
<codeline lineno="2241"><highlight class="normal"><sp/><sp/><sp/><sp/>usb_val<sp/>=<sp/>eventch;</highlight></codeline>
<codeline lineno="2242"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(enable)</highlight></codeline>
<codeline lineno="2243"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>usb_val<sp/>|=<sp/>1<sp/>&lt;&lt;<sp/>8;</highlight></codeline>
<codeline lineno="2244"><highlight class="normal"></highlight></codeline>
<codeline lineno="2245"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1a50f11e536f110d96eb90687d07e481d5" kindref="member">SIO_SET_EVENT_CHAR_REQUEST</ref>,<sp/>usb_val,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,<sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="2246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;setting<sp/>event<sp/>character<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2247"><highlight class="normal"></highlight></codeline>
<codeline lineno="2248"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2249"><highlight class="normal">}</highlight></codeline>
<codeline lineno="2250"><highlight class="normal"></highlight></codeline>
<codeline lineno="2262" refid="group__libftdi_1gaeb9510a61f6648eb1bd57f0f99a390e1" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gaeb9510a61f6648eb1bd57f0f99a390e1" kindref="member">ftdi_set_error_char</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,</highlight></codeline>
<codeline lineno="2263"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>errorch,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>enable)</highlight></codeline>
<codeline lineno="2264"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2265"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>usb_val;</highlight></codeline>
<codeline lineno="2266"><highlight class="normal"></highlight></codeline>
<codeline lineno="2267"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2269"><highlight class="normal"></highlight></codeline>
<codeline lineno="2270"><highlight class="normal"><sp/><sp/><sp/><sp/>usb_val<sp/>=<sp/>errorch;</highlight></codeline>
<codeline lineno="2271"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(enable)</highlight></codeline>
<codeline lineno="2272"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>usb_val<sp/>|=<sp/>1<sp/>&lt;&lt;<sp/>8;</highlight></codeline>
<codeline lineno="2273"><highlight class="normal"></highlight></codeline>
<codeline lineno="2274"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1a5c01e46988dff16f8e0754198443d1f1" kindref="member">SIO_SET_ERROR_CHAR_REQUEST</ref>,<sp/>usb_val,<sp/>ftdi-&gt;<ref refid="structftdi__context_1aa38ced8c782ed6844895cd4d685def64" kindref="member">index</ref>,<sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="2275"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;setting<sp/>error<sp/>character<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2276"><highlight class="normal"></highlight></codeline>
<codeline lineno="2277"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2278"><highlight class="normal">}</highlight></codeline>
<codeline lineno="2279"><highlight class="normal"></highlight></codeline>
<codeline lineno="2292" refid="group__libftdi_1ga0b04717765deb6706482a3f3124c0b4a" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga0b04717765deb6706482a3f3124c0b4a" kindref="member">ftdi_eeprom_initdefaults</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>manufacturer,</highlight></codeline>
<codeline lineno="2293"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>product,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>serial)</highlight></codeline>
<codeline lineno="2294"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2295"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__eeprom" kindref="compound" tooltip="FTDI eeprom structure.">ftdi_eeprom</ref><sp/>*eeprom;</highlight></codeline>
<codeline lineno="2296"><highlight class="normal"></highlight></codeline>
<codeline lineno="2297"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2298"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;No<sp/>struct<sp/>ftdi_context&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2299"><highlight class="normal"></highlight></codeline>
<codeline lineno="2300"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2301"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,</highlight><highlight class="stringliteral">&quot;No<sp/>struct<sp/>ftdi_eeprom&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2302"><highlight class="normal"></highlight></codeline>
<codeline lineno="2303"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>;</highlight></codeline>
<codeline lineno="2304"><highlight class="normal"><sp/><sp/><sp/><sp/>memset(eeprom,<sp/>0,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__eeprom" kindref="compound" tooltip="FTDI eeprom structure.">ftdi_eeprom</ref>));</highlight></codeline>
<codeline lineno="2305"><highlight class="normal"></highlight></codeline>
<codeline lineno="2306"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2307"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;No<sp/>connected<sp/>device<sp/>or<sp/>device<sp/>not<sp/>yet<sp/>opened&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2308"><highlight class="normal"></highlight></codeline>
<codeline lineno="2309"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1af591e992b9bd12a484ea9d4d36e92251" kindref="member">vendor_id</ref><sp/>=<sp/>0x0403;</highlight></codeline>
<codeline lineno="2310"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1abe250275595d020fd8de3aa61d093d38" kindref="member">use_serial</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="2311"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" kindref="member">TYPE_AM</ref>)<sp/>||<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>)<sp/>||</highlight></codeline>
<codeline lineno="2312"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>))</highlight></codeline>
<codeline lineno="2313"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" kindref="member">product_id</ref><sp/>=<sp/>0x6001;</highlight></codeline>
<codeline lineno="2314"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref>)</highlight></codeline>
<codeline lineno="2315"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" kindref="member">product_id</ref><sp/>=<sp/>0x6011;</highlight></codeline>
<codeline lineno="2316"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>)</highlight></codeline>
<codeline lineno="2317"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" kindref="member">product_id</ref><sp/>=<sp/>0x6014;</highlight></codeline>
<codeline lineno="2318"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2319"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" kindref="member">product_id</ref><sp/>=<sp/>0x6010;</highlight></codeline>
<codeline lineno="2320"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" kindref="member">TYPE_AM</ref>)</highlight></codeline>
<codeline lineno="2321"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" kindref="member">usb_version</ref><sp/>=<sp/>0x0101;</highlight></codeline>
<codeline lineno="2322"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2323"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" kindref="member">usb_version</ref><sp/>=<sp/>0x0200;</highlight></codeline>
<codeline lineno="2324"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a8aa39af43a6ac5c05b8682d8b3904e3c" kindref="member">max_power</ref><sp/>=<sp/>100;</highlight></codeline>
<codeline lineno="2325"><highlight class="normal"></highlight></codeline>
<codeline lineno="2326"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>)</highlight></codeline>
<codeline lineno="2327"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free<sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>);</highlight></codeline>
<codeline lineno="2328"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="2329"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(manufacturer)</highlight></codeline>
<codeline lineno="2330"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2331"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref><sp/>=<sp/>malloc(strlen(manufacturer)+1);</highlight></codeline>
<codeline lineno="2332"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>)</highlight></codeline>
<codeline lineno="2333"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strcpy(eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>,<sp/>manufacturer);</highlight></codeline>
<codeline lineno="2334"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2335"><highlight class="normal"></highlight></codeline>
<codeline lineno="2336"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>)</highlight></codeline>
<codeline lineno="2337"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free<sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>);</highlight></codeline>
<codeline lineno="2338"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="2339"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(product)</highlight></codeline>
<codeline lineno="2340"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2341"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref><sp/>=<sp/>malloc(strlen(product)+1);</highlight></codeline>
<codeline lineno="2342"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>)</highlight></codeline>
<codeline lineno="2343"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strcpy(eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>,<sp/>product);</highlight></codeline>
<codeline lineno="2344"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2345"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2346"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2347"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>default_product;</highlight></codeline>
<codeline lineno="2348"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal">(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref>)</highlight></codeline>
<codeline lineno="2349"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2350"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" kindref="member">TYPE_AM</ref>:<sp/><sp/><sp/><sp/>default_product<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;AM&quot;</highlight><highlight class="normal">;<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2351"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>:<sp/><sp/><sp/><sp/>default_product<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;BM&quot;</highlight><highlight class="normal">;<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2352"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>:<sp/>default_product<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;Dual<sp/>RS232&quot;</highlight><highlight class="normal">;<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2353"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>:<sp/><sp/><sp/><sp/><sp/>default_product<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;FT232R<sp/>USB<sp/>UART&quot;</highlight><highlight class="normal">;<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2354"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>:<sp/>default_product<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;Dual<sp/>RS232-HS&quot;</highlight><highlight class="normal">;<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2355"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref>:<sp/>default_product<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;FT4232H&quot;</highlight><highlight class="normal">;<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2356"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>:<sp/><sp/>default_product<sp/>=<sp/></highlight><highlight class="stringliteral">&quot;Single-RS232-HS&quot;</highlight><highlight class="normal">;<sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2357"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="2358"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;Unknown<sp/>chip<sp/>type&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2359"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2360"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref><sp/>=<sp/>malloc(strlen(default_product)<sp/>+1);</highlight></codeline>
<codeline lineno="2361"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>)</highlight></codeline>
<codeline lineno="2362"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strcpy(eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>,<sp/>default_product);</highlight></codeline>
<codeline lineno="2363"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2364"><highlight class="normal"></highlight></codeline>
<codeline lineno="2365"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>)</highlight></codeline>
<codeline lineno="2366"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free<sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>);</highlight></codeline>
<codeline lineno="2367"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="2368"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(serial)</highlight></codeline>
<codeline lineno="2369"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2370"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref><sp/>=<sp/>malloc(strlen(serial)+1);</highlight></codeline>
<codeline lineno="2371"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>)</highlight></codeline>
<codeline lineno="2372"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>strcpy(eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>,<sp/>serial);</highlight></codeline>
<codeline lineno="2373"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2374"><highlight class="normal"></highlight></codeline>
<codeline lineno="2375"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>)</highlight></codeline>
<codeline lineno="2376"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2377"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a8aa39af43a6ac5c05b8682d8b3904e3c" kindref="member">max_power</ref><sp/>=<sp/>90;</highlight></codeline>
<codeline lineno="2378"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref><sp/>=<sp/>0x80;</highlight></codeline>
<codeline lineno="2379"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[0]<sp/>=<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a0951f6293488ba4fa6cccde4c3acc7dd" kindref="member">CBUS_TXLED</ref>;</highlight></codeline>
<codeline lineno="2380"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[1]<sp/>=<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a6843d248e73c2282a3f1554afec757ea" kindref="member">CBUS_RXLED</ref>;</highlight></codeline>
<codeline lineno="2381"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[2]<sp/>=<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a82dad8e9b80ece6a5924b7cccb4825de" kindref="member">CBUS_TXDEN</ref>;</highlight></codeline>
<codeline lineno="2382"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[3]<sp/>=<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a1315b5812fad8f70ec7d1a9b7c30533b" kindref="member">CBUS_PWREN</ref>;</highlight></codeline>
<codeline lineno="2383"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[4]<sp/>=<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a1316ff4aa58d6b250d3a8d1e61d2afef" kindref="member">CBUS_SLEEP</ref>;</highlight></codeline>
<codeline lineno="2384"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2385"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2386"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2387"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>)</highlight></codeline>
<codeline lineno="2388"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2389"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="2390"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;10;<sp/>i++)</highlight></codeline>
<codeline lineno="2391"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[i]<sp/>=<sp/><ref refid="ftdi_8h_1a5b83df6ac73aeb8f0126ebe2efcebfc2a7be26ae2dd9dfea0b5fa42cdc394fabc" kindref="member">CBUSH_TRISTATE</ref>;</highlight></codeline>
<codeline lineno="2392"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2393"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref><sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="2394"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2395"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a7a44fb7a64c3114f33561aa6214e5182" kindref="member">initialized_for_connected_device</ref><sp/>=<sp/>1;</highlight></codeline>
<codeline lineno="2396"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2397"><highlight class="normal">}</highlight></codeline>
<codeline lineno="2398"><highlight class="normal"></highlight><highlight class="comment">/*FTD2XX<sp/>doesn&apos;t<sp/>check<sp/>for<sp/>values<sp/>not<sp/>fitting<sp/>in<sp/>the<sp/>ACBUS<sp/>Signal<sp/>oprtions*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2399" refid="group__libftdi_1ga4c5f8b615c0db9ed6deefaf57563e3f5" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga4c5f8b615c0db9ed6deefaf57563e3f5" kindref="member">set_ft232h_cbus</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__eeprom" kindref="compound" tooltip="FTDI eeprom structure.">ftdi_eeprom</ref><sp/>*eeprom,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>output)</highlight></codeline>
<codeline lineno="2400"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2401"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="2402"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;<sp/>i&lt;5;i++)</highlight></codeline>
<codeline lineno="2403"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2404"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>mode_low,<sp/>mode_high;</highlight></codeline>
<codeline lineno="2405"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[2*i]&gt;<sp/><ref refid="ftdi_8h_1a5b83df6ac73aeb8f0126ebe2efcebfc2a2d2d141e7e78469b4aff505263231a87" kindref="member">CBUSH_CLK7_5</ref>)</highlight></codeline>
<codeline lineno="2406"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mode_low<sp/>=<sp/><ref refid="ftdi_8h_1a5b83df6ac73aeb8f0126ebe2efcebfc2a7be26ae2dd9dfea0b5fa42cdc394fabc" kindref="member">CBUSH_TRISTATE</ref>;</highlight></codeline>
<codeline lineno="2407"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2408"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mode_low<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[2*i];</highlight></codeline>
<codeline lineno="2409"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[2*i+1]&gt;<sp/><ref refid="ftdi_8h_1a5b83df6ac73aeb8f0126ebe2efcebfc2a2d2d141e7e78469b4aff505263231a87" kindref="member">CBUSH_CLK7_5</ref>)</highlight></codeline>
<codeline lineno="2410"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mode_high<sp/>=<sp/><ref refid="ftdi_8h_1a5b83df6ac73aeb8f0126ebe2efcebfc2a7be26ae2dd9dfea0b5fa42cdc394fabc" kindref="member">CBUSH_TRISTATE</ref>;</highlight></codeline>
<codeline lineno="2411"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2412"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>mode_high<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[2*i+1];</highlight></codeline>
<codeline lineno="2413"><highlight class="normal"></highlight></codeline>
<codeline lineno="2414"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x18+i]<sp/>=<sp/>(mode_high<sp/>&lt;&lt;4)<sp/>|<sp/>mode_low;</highlight></codeline>
<codeline lineno="2415"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2416"><highlight class="normal">}</highlight></codeline>
<codeline lineno="2417"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Return<sp/>the<sp/>bits<sp/>for<sp/>the<sp/>encoded<sp/>EEPROM<sp/>Structure<sp/>of<sp/>a<sp/>requested<sp/>Mode</highlight></codeline>
<codeline lineno="2418"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="2419"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2420"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>type2bit(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>type,<sp/></highlight><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ce" kindref="member">ftdi_chip_type</ref><sp/><ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref>)</highlight></codeline>
<codeline lineno="2421"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2422"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(chip)</highlight></codeline>
<codeline lineno="2423"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2424"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>:</highlight></codeline>
<codeline lineno="2425"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>:</highlight></codeline>
<codeline lineno="2426"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2427"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(type)</highlight></codeline>
<codeline lineno="2428"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2429"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ae5cad0e9c60b369bffd8183c8ea2b9b2" kindref="member">CHANNEL_IS_UART</ref>:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2430"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1af78e3df1428821d0f91aec62b1c26805" kindref="member">CHANNEL_IS_FIFO</ref>:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0x01;</highlight></codeline>
<codeline lineno="2431"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1aadc4e0dc12a87ef1d2bf7234330bec75" kindref="member">CHANNEL_IS_OPTO</ref>:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0x02;</highlight></codeline>
<codeline lineno="2432"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a7b1430e3f1529193e10fa64ea0f156a9" kindref="member">CHANNEL_IS_CPU</ref><sp/>:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0x04;</highlight></codeline>
<codeline lineno="2433"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2434"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2435"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2436"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>:</highlight></codeline>
<codeline lineno="2437"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2438"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(type)</highlight></codeline>
<codeline lineno="2439"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2440"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ae5cad0e9c60b369bffd8183c8ea2b9b2" kindref="member">CHANNEL_IS_UART</ref><sp/><sp/><sp/>:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2441"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1af78e3df1428821d0f91aec62b1c26805" kindref="member">CHANNEL_IS_FIFO</ref><sp/><sp/><sp/>:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0x01;</highlight></codeline>
<codeline lineno="2442"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1aadc4e0dc12a87ef1d2bf7234330bec75" kindref="member">CHANNEL_IS_OPTO</ref><sp/><sp/><sp/>:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0x02;</highlight></codeline>
<codeline lineno="2443"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a7b1430e3f1529193e10fa64ea0f156a9" kindref="member">CHANNEL_IS_CPU</ref><sp/><sp/><sp/><sp/>:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0x04;</highlight></codeline>
<codeline lineno="2444"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a4ade952468d6ba7278c9d27dd73e2f03" kindref="member">CHANNEL_IS_FT1284</ref><sp/>:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0x08;</highlight></codeline>
<codeline lineno="2445"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2446"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2447"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2448"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2449"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2450"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="2451"><highlight class="normal">}<sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="2452"><highlight class="normal"></highlight></codeline>
<codeline lineno="2467" refid="group__libftdi_1gaccf7f39923b4a9bbc626cca9f7ac40b1" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gaccf7f39923b4a9bbc626cca9f7ac40b1" kindref="member">ftdi_eeprom_build</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="2468"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2469"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>i,<sp/>j,<sp/>eeprom_size_mask;</highlight></codeline>
<codeline lineno="2470"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>checksum,<sp/>value;</highlight></codeline>
<codeline lineno="2471"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>manufacturer_size<sp/>=<sp/>0,<sp/>product_size<sp/>=<sp/>0,<sp/>serial_size<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="2472"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>user_area_size;</highlight></codeline>
<codeline lineno="2473"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__eeprom" kindref="compound" tooltip="FTDI eeprom structure.">ftdi_eeprom</ref><sp/>*eeprom;</highlight></codeline>
<codeline lineno="2474"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/>output;</highlight></codeline>
<codeline lineno="2475"><highlight class="normal"></highlight></codeline>
<codeline lineno="2476"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2477"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,</highlight><highlight class="stringliteral">&quot;No<sp/>context&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2478"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="2479"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,</highlight><highlight class="stringliteral">&quot;No<sp/>eeprom<sp/>structure&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2480"><highlight class="normal"></highlight></codeline>
<codeline lineno="2481"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>;</highlight></codeline>
<codeline lineno="2482"><highlight class="normal"><sp/><sp/><sp/><sp/>output<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" kindref="member">buf</ref>;</highlight></codeline>
<codeline lineno="2483"><highlight class="normal"></highlight></codeline>
<codeline lineno="2484"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>==<sp/>-1)</highlight></codeline>
<codeline lineno="2485"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-6,</highlight><highlight class="stringliteral">&quot;No<sp/>connected<sp/>EEPROM<sp/>or<sp/>EEPROM<sp/>type<sp/>unknown&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2486"><highlight class="normal"></highlight></codeline>
<codeline lineno="2487"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>==<sp/>0x56)<sp/>||<sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>==<sp/>0x66))</highlight></codeline>
<codeline lineno="2488"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref><sp/>=<sp/>0x100;</highlight></codeline>
<codeline lineno="2489"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2490"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref><sp/>=<sp/>0x80;</highlight></codeline>
<codeline lineno="2491"><highlight class="normal"></highlight></codeline>
<codeline lineno="2492"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref><sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="2493"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>manufacturer_size<sp/>=<sp/>strlen(eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>);</highlight></codeline>
<codeline lineno="2494"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref><sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="2495"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>product_size<sp/>=<sp/>strlen(eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>);</highlight></codeline>
<codeline lineno="2496"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref><sp/>!=<sp/>NULL)</highlight></codeline>
<codeline lineno="2497"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>serial_size<sp/>=<sp/>strlen(eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>);</highlight></codeline>
<codeline lineno="2498"><highlight class="normal"></highlight></codeline>
<codeline lineno="2499"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>eeprom<sp/>size<sp/>check</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2500"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref>)</highlight></codeline>
<codeline lineno="2501"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2502"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" kindref="member">TYPE_AM</ref>:</highlight></codeline>
<codeline lineno="2503"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>:</highlight></codeline>
<codeline lineno="2504"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>user_area_size<sp/>=<sp/>96;<sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>base<sp/>size<sp/>for<sp/>strings<sp/>(total<sp/>of<sp/>48<sp/>characters)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2505"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2506"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>:</highlight></codeline>
<codeline lineno="2507"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>user_area_size<sp/>=<sp/>90;<sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>two<sp/>extra<sp/>config<sp/>bytes<sp/>and<sp/>4<sp/>bytes<sp/>PnP<sp/>stuff</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2508"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2509"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>:</highlight></codeline>
<codeline lineno="2510"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>user_area_size<sp/>=<sp/>88;<sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>four<sp/>extra<sp/>config<sp/>bytes<sp/>+<sp/>4<sp/>bytes<sp/>PnP<sp/>stuff</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2511"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2512"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>:<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>six<sp/>extra<sp/>config<sp/>bytes<sp/>+<sp/>4<sp/>bytes<sp/>PnP<sp/>stuff</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2513"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref>:</highlight></codeline>
<codeline lineno="2514"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>user_area_size<sp/>=<sp/>86;</highlight></codeline>
<codeline lineno="2515"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2516"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>:</highlight></codeline>
<codeline lineno="2517"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>user_area_size<sp/>=<sp/>80;</highlight></codeline>
<codeline lineno="2518"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2519"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="2520"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>user_area_size<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="2521"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2522"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2523"><highlight class="normal"><sp/><sp/><sp/><sp/>user_area_size<sp/><sp/>-=<sp/>(manufacturer_size<sp/>+<sp/>product_size<sp/>+<sp/>serial_size)<sp/>*<sp/>2;</highlight></codeline>
<codeline lineno="2524"><highlight class="normal"></highlight></codeline>
<codeline lineno="2525"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(user_area_size<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="2526"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,</highlight><highlight class="stringliteral">&quot;eeprom<sp/>size<sp/>exceeded&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2527"><highlight class="normal"></highlight></codeline>
<codeline lineno="2528"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>empty<sp/>eeprom</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2529"><highlight class="normal"><sp/><sp/><sp/><sp/>memset<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" kindref="member">buf</ref>,<sp/>0,<sp/><ref refid="ftdi__i_8h_1a0c61fd6cfc8b3ec904d270a7980e8f37" kindref="member">FTDI_MAX_EEPROM_SIZE</ref>);</highlight></codeline>
<codeline lineno="2530"><highlight class="normal"></highlight></codeline>
<codeline lineno="2531"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bytes<sp/>and<sp/>Bits<sp/>set<sp/>for<sp/>all<sp/>Types</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2532"><highlight class="normal"></highlight></codeline>
<codeline lineno="2533"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>02:<sp/>Vendor<sp/>ID</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2534"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x02]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1af591e992b9bd12a484ea9d4d36e92251" kindref="member">vendor_id</ref>;</highlight></codeline>
<codeline lineno="2535"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x03]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1af591e992b9bd12a484ea9d4d36e92251" kindref="member">vendor_id</ref><sp/>&gt;&gt;<sp/>8;</highlight></codeline>
<codeline lineno="2536"><highlight class="normal"></highlight></codeline>
<codeline lineno="2537"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>04:<sp/>Product<sp/>ID</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2538"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x04]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" kindref="member">product_id</ref>;</highlight></codeline>
<codeline lineno="2539"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x05]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" kindref="member">product_id</ref><sp/>&gt;&gt;<sp/>8;</highlight></codeline>
<codeline lineno="2540"><highlight class="normal"></highlight></codeline>
<codeline lineno="2541"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>06:<sp/>Device<sp/>release<sp/>number<sp/>(0400h<sp/>for<sp/>BM<sp/>features)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2542"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x06]<sp/>=<sp/>0x00;</highlight></codeline>
<codeline lineno="2543"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref>)</highlight></codeline>
<codeline lineno="2544"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2545"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" kindref="member">TYPE_AM</ref>:</highlight></codeline>
<codeline lineno="2546"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x07]<sp/>=<sp/>0x02;</highlight></codeline>
<codeline lineno="2547"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2548"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>:</highlight></codeline>
<codeline lineno="2549"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x07]<sp/>=<sp/>0x04;</highlight></codeline>
<codeline lineno="2550"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2551"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>:</highlight></codeline>
<codeline lineno="2552"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x07]<sp/>=<sp/>0x05;</highlight></codeline>
<codeline lineno="2553"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2554"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>:</highlight></codeline>
<codeline lineno="2555"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x07]<sp/>=<sp/>0x06;</highlight></codeline>
<codeline lineno="2556"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2557"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>:</highlight></codeline>
<codeline lineno="2558"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x07]<sp/>=<sp/>0x07;</highlight></codeline>
<codeline lineno="2559"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2560"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref>:</highlight></codeline>
<codeline lineno="2561"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x07]<sp/>=<sp/>0x08;</highlight></codeline>
<codeline lineno="2562"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2563"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>:</highlight></codeline>
<codeline lineno="2564"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x07]<sp/>=<sp/>0x09;</highlight></codeline>
<codeline lineno="2565"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2566"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="2567"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x07]<sp/>=<sp/>0x00;</highlight></codeline>
<codeline lineno="2568"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2569"><highlight class="normal"></highlight></codeline>
<codeline lineno="2570"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>08:<sp/>Config<sp/>descriptor</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2571"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>7:<sp/>always<sp/>1</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2572"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>6:<sp/>1<sp/>if<sp/>this<sp/>device<sp/>is<sp/>self<sp/>powered,<sp/>0<sp/>if<sp/>bus<sp/>powered</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2573"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>5:<sp/>1<sp/>if<sp/>this<sp/>device<sp/>uses<sp/>remote<sp/>wakeup</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2574"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>4-0:<sp/>reserved<sp/>-<sp/>0</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2575"><highlight class="normal"><sp/><sp/><sp/><sp/>j<sp/>=<sp/>0x80;</highlight></codeline>
<codeline lineno="2576"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a055d6bef2328557e6ac4d2909e42d21b" kindref="member">self_powered</ref><sp/>==<sp/>1)</highlight></codeline>
<codeline lineno="2577"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>j<sp/>|=<sp/>0x40;</highlight></codeline>
<codeline lineno="2578"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a9b82f88497b432bebfa4dd92c304cb02" kindref="member">remote_wakeup</ref><sp/>==<sp/>1)</highlight></codeline>
<codeline lineno="2579"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>j<sp/>|=<sp/>0x20;</highlight></codeline>
<codeline lineno="2580"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x08]<sp/>=<sp/>j;</highlight></codeline>
<codeline lineno="2581"><highlight class="normal"></highlight></codeline>
<codeline lineno="2582"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>09:<sp/>Max<sp/>power<sp/>consumption:<sp/>max<sp/>power<sp/>=<sp/>value<sp/>*<sp/>2<sp/>mA</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2583"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x09]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a8aa39af43a6ac5c05b8682d8b3904e3c" kindref="member">max_power</ref><sp/>/<sp/><ref refid="ftdi__i_8h_1ad4d084064eecf35f2bcaeae257f9d517" kindref="member">MAX_POWER_MILLIAMP_PER_UNIT</ref>;</highlight></codeline>
<codeline lineno="2584"><highlight class="normal"></highlight></codeline>
<codeline lineno="2585"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>!=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" kindref="member">TYPE_AM</ref>)</highlight></codeline>
<codeline lineno="2586"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2587"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>0A:<sp/>Chip<sp/>configuration</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2588"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>7:<sp/>0<sp/>-<sp/>reserved</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2589"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>6:<sp/>0<sp/>-<sp/>reserved</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2590"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>5:<sp/>0<sp/>-<sp/>reserved</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2591"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>4:<sp/>1<sp/>-<sp/>Change<sp/>USB<sp/>version</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2592"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>3:<sp/>1<sp/>-<sp/>Use<sp/>the<sp/>serial<sp/>number<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2593"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>2:<sp/>1<sp/>-<sp/>Enable<sp/>suspend<sp/>pull<sp/>downs<sp/>for<sp/>lower<sp/>power</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2594"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>1:<sp/>1<sp/>-<sp/>Out<sp/>EndPoint<sp/>is<sp/>Isochronous</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2595"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>0:<sp/>1<sp/>-<sp/>In<sp/>EndPoint<sp/>is<sp/>Isochronous</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2596"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2597"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>j<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="2598"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a5117b50c00668aff73b5df385b0fc5f8" kindref="member">in_is_isochronous</ref><sp/>==<sp/>1)</highlight></codeline>
<codeline lineno="2599"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>j<sp/>=<sp/>j<sp/>|<sp/>1;</highlight></codeline>
<codeline lineno="2600"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab9885ee665c318a8d19c28a9c75b999a" kindref="member">out_is_isochronous</ref><sp/>==<sp/>1)</highlight></codeline>
<codeline lineno="2601"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>j<sp/>=<sp/>j<sp/>|<sp/>2;</highlight></codeline>
<codeline lineno="2602"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>=<sp/>j;</highlight></codeline>
<codeline lineno="2603"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2604"><highlight class="normal"></highlight></codeline>
<codeline lineno="2605"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Dynamic<sp/>content</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2606"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Strings<sp/>start<sp/>at<sp/>0x94<sp/>(TYPE_AM,<sp/>TYPE_BM)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2607"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>0x96<sp/>(TYPE_2232C),<sp/>0x98<sp/>(TYPE_R)<sp/>and<sp/>0x9a<sp/>(TYPE_x232H)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2608"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>0xa0<sp/>(TYPE_232H)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2609"><highlight class="normal"><sp/><sp/><sp/><sp/>i<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="2610"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref>)</highlight></codeline>
<codeline lineno="2611"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2612"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>:</highlight></codeline>
<codeline lineno="2613"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/>+=<sp/>2;</highlight></codeline>
<codeline lineno="2614"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>:</highlight></codeline>
<codeline lineno="2615"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref>:</highlight></codeline>
<codeline lineno="2616"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/>+=<sp/>2;</highlight></codeline>
<codeline lineno="2617"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>:</highlight></codeline>
<codeline lineno="2618"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/>+=<sp/>2;</highlight></codeline>
<codeline lineno="2619"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>:</highlight></codeline>
<codeline lineno="2620"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/>+=<sp/>2;</highlight></codeline>
<codeline lineno="2621"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" kindref="member">TYPE_AM</ref>:</highlight></codeline>
<codeline lineno="2622"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>:</highlight></codeline>
<codeline lineno="2623"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/>+=<sp/>0x94;</highlight></codeline>
<codeline lineno="2624"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2625"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Wrap<sp/>around<sp/>0x80<sp/>for<sp/>128<sp/>byte<sp/>EEPROMS<sp/>(Internale<sp/>and<sp/>93x46)<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2626"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom_size_mask<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref><sp/>-1;</highlight></codeline>
<codeline lineno="2627"><highlight class="normal"></highlight></codeline>
<codeline lineno="2628"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>0E:<sp/>Offset<sp/>of<sp/>the<sp/>manufacturer<sp/>string<sp/>+<sp/>0x80,<sp/>calculated<sp/>later</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2629"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>0F:<sp/>Length<sp/>of<sp/>manufacturer<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2630"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Output<sp/>manufacturer</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2631"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x0E]<sp/>=<sp/>i;<sp/><sp/></highlight><highlight class="comment">//<sp/>calculate<sp/>offset</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2632"><highlight class="normal"><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>manufacturer_size*2<sp/>+<sp/>2,<sp/>i++;</highlight></codeline>
<codeline lineno="2633"><highlight class="normal"><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>0x03,<sp/>i++;<sp/></highlight><highlight class="comment">//<sp/>type:<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2634"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j<sp/>=<sp/>0;<sp/>j<sp/>&lt;<sp/>manufacturer_size;<sp/>j++)</highlight></codeline>
<codeline lineno="2635"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2636"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>[j],<sp/>i++;</highlight></codeline>
<codeline lineno="2637"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>0x00,<sp/>i++;</highlight></codeline>
<codeline lineno="2638"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2639"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x0F]<sp/>=<sp/>manufacturer_size*2<sp/>+<sp/>2;</highlight></codeline>
<codeline lineno="2640"><highlight class="normal"></highlight></codeline>
<codeline lineno="2641"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>10:<sp/>Offset<sp/>of<sp/>the<sp/>product<sp/>string<sp/>+<sp/>0x80,<sp/>calculated<sp/>later</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2642"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>11:<sp/>Length<sp/>of<sp/>product<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2643"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x10]<sp/>=<sp/>i<sp/>|<sp/>0x80;<sp/><sp/></highlight><highlight class="comment">//<sp/>calculate<sp/>offset</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2644"><highlight class="normal"><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>product_size*2<sp/>+<sp/>2,<sp/>i++;</highlight></codeline>
<codeline lineno="2645"><highlight class="normal"><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>0x03,<sp/>i++;</highlight></codeline>
<codeline lineno="2646"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j<sp/>=<sp/>0;<sp/>j<sp/>&lt;<sp/>product_size;<sp/>j++)</highlight></codeline>
<codeline lineno="2647"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2648"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>[j],<sp/>i++;</highlight></codeline>
<codeline lineno="2649"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>0x00,<sp/>i++;</highlight></codeline>
<codeline lineno="2650"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2651"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x11]<sp/>=<sp/>product_size*2<sp/>+<sp/>2;</highlight></codeline>
<codeline lineno="2652"><highlight class="normal"></highlight></codeline>
<codeline lineno="2653"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>12:<sp/>Offset<sp/>of<sp/>the<sp/>serial<sp/>string<sp/>+<sp/>0x80,<sp/>calculated<sp/>later</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2654"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>13:<sp/>Length<sp/>of<sp/>serial<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2655"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x12]<sp/>=<sp/>i<sp/>|<sp/>0x80;<sp/></highlight><highlight class="comment">//<sp/>calculate<sp/>offset</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2656"><highlight class="normal"><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>serial_size*2<sp/>+<sp/>2,<sp/>i++;</highlight></codeline>
<codeline lineno="2657"><highlight class="normal"><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>0x03,<sp/>i++;</highlight></codeline>
<codeline lineno="2658"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j<sp/>=<sp/>0;<sp/>j<sp/>&lt;<sp/>serial_size;<sp/>j++)</highlight></codeline>
<codeline lineno="2659"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2660"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>[j],<sp/>i++;</highlight></codeline>
<codeline lineno="2661"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>0x00,<sp/>i++;</highlight></codeline>
<codeline lineno="2662"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2663"><highlight class="normal"></highlight></codeline>
<codeline lineno="2664"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Legacy<sp/>port<sp/>name<sp/>and<sp/>PnP<sp/>fields<sp/>for<sp/>FT2232<sp/>and<sp/>newer<sp/>chips</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2665"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>&gt;<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>)</highlight></codeline>
<codeline lineno="2666"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2667"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>0x02;<sp/></highlight><highlight class="comment">/*<sp/>as<sp/>seen<sp/>when<sp/>written<sp/>with<sp/>FTD2XX<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2668"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i++;</highlight></codeline>
<codeline lineno="2669"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>0x03;<sp/></highlight><highlight class="comment">/*<sp/>as<sp/>seen<sp/>when<sp/>written<sp/>with<sp/>FTD2XX<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2670"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i++;</highlight></codeline>
<codeline lineno="2671"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[i<sp/>&amp;<sp/>eeprom_size_mask]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a30dad8c71143befc6f947bcf04e63aa2" kindref="member">is_not_pnp</ref>;<sp/></highlight><highlight class="comment">/*<sp/>as<sp/>seen<sp/>when<sp/>written<sp/>with<sp/>FTD2XX<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2672"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i++;</highlight></codeline>
<codeline lineno="2673"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2674"><highlight class="normal"></highlight></codeline>
<codeline lineno="2675"><highlight class="normal"><sp/><sp/><sp/><sp/>output[0x13]<sp/>=<sp/>serial_size*2<sp/>+<sp/>2;</highlight></codeline>
<codeline lineno="2676"><highlight class="normal"></highlight></codeline>
<codeline lineno="2677"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>&gt;<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" kindref="member">TYPE_AM</ref>)<sp/></highlight><highlight class="comment">/*<sp/>use_serial<sp/>not<sp/>used<sp/>in<sp/>AM<sp/>devices<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2678"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2679"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1abe250275595d020fd8de3aa61d093d38" kindref="member">use_serial</ref>)</highlight></codeline>
<codeline lineno="2680"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>|=<sp/><ref refid="ftdi_8h_1a100304658f531729f8961ac2b5609fb1" kindref="member">USE_SERIAL_NUM</ref>;</highlight></codeline>
<codeline lineno="2681"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2682"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a100304658f531729f8961ac2b5609fb1" kindref="member">USE_SERIAL_NUM</ref>;</highlight></codeline>
<codeline lineno="2683"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2684"><highlight class="normal"></highlight></codeline>
<codeline lineno="2685"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Bytes<sp/>and<sp/>Bits<sp/>specific<sp/>to<sp/>(some)<sp/>types</highlight></codeline>
<codeline lineno="2686"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Write<sp/>linear,<sp/>as<sp/>this<sp/>allows<sp/>easier<sp/>fixing*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2687"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref>)</highlight></codeline>
<codeline lineno="2688"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2689"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" kindref="member">TYPE_AM</ref>:</highlight></codeline>
<codeline lineno="2690"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2691"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>:</highlight></codeline>
<codeline lineno="2692"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0C]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" kindref="member">usb_version</ref><sp/>&amp;<sp/>0xff;</highlight></codeline>
<codeline lineno="2693"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0D]<sp/>=<sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" kindref="member">usb_version</ref>&gt;&gt;8)<sp/>&amp;<sp/>0xff;</highlight></codeline>
<codeline lineno="2694"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a54772c4686e082384adee26eeaa68005" kindref="member">use_usb_version</ref><sp/>==<sp/><ref refid="ftdi_8h_1ae6a585cfccd26ea11cb195877d49b211" kindref="member">USE_USB_VERSION_BIT</ref>)</highlight></codeline>
<codeline lineno="2695"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>|=<sp/><ref refid="ftdi_8h_1ae6a585cfccd26ea11cb195877d49b211" kindref="member">USE_USB_VERSION_BIT</ref>;</highlight></codeline>
<codeline lineno="2696"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2697"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1ae6a585cfccd26ea11cb195877d49b211" kindref="member">USE_USB_VERSION_BIT</ref>;</highlight></codeline>
<codeline lineno="2698"><highlight class="normal"></highlight></codeline>
<codeline lineno="2699"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2700"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>:</highlight></codeline>
<codeline lineno="2701"><highlight class="normal"></highlight></codeline>
<codeline lineno="2702"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>=<sp/>type2bit(eeprom-&gt;<ref refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" kindref="member">channel_a_type</ref>,<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>);</highlight></codeline>
<codeline lineno="2703"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" kindref="member">channel_a_driver</ref><sp/>==<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>)</highlight></codeline>
<codeline lineno="2704"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>|=<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="2705"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2706"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="2707"><highlight class="normal"></highlight></codeline>
<codeline lineno="2708"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a4bf7b50ec4259aa83623bc9ed789c429" kindref="member">high_current_a</ref><sp/>==<sp/><ref refid="ftdi_8h_1a0b41f0434b3f10219bfbfc0ae02d60a0" kindref="member">HIGH_CURRENT_DRIVE</ref>)</highlight></codeline>
<codeline lineno="2709"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>|=<sp/><ref refid="ftdi_8h_1a0b41f0434b3f10219bfbfc0ae02d60a0" kindref="member">HIGH_CURRENT_DRIVE</ref>;</highlight></codeline>
<codeline lineno="2710"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2711"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a0b41f0434b3f10219bfbfc0ae02d60a0" kindref="member">HIGH_CURRENT_DRIVE</ref>;</highlight></codeline>
<codeline lineno="2712"><highlight class="normal"></highlight></codeline>
<codeline lineno="2713"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>=<sp/>type2bit(eeprom-&gt;<ref refid="structftdi__eeprom_1a2da524307ba5904880ba6e2456adc4c1" kindref="member">channel_b_type</ref>,<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>);</highlight></codeline>
<codeline lineno="2714"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a128def5dc4387fdcdaddaa7c9f460637" kindref="member">channel_b_driver</ref><sp/>==<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>)</highlight></codeline>
<codeline lineno="2715"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>|=<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="2716"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2717"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="2718"><highlight class="normal"></highlight></codeline>
<codeline lineno="2719"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a5016f08e6af06307abe71c15165d24ab" kindref="member">high_current_b</ref><sp/>==<sp/><ref refid="ftdi_8h_1a0b41f0434b3f10219bfbfc0ae02d60a0" kindref="member">HIGH_CURRENT_DRIVE</ref>)</highlight></codeline>
<codeline lineno="2720"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>|=<sp/><ref refid="ftdi_8h_1a0b41f0434b3f10219bfbfc0ae02d60a0" kindref="member">HIGH_CURRENT_DRIVE</ref>;</highlight></codeline>
<codeline lineno="2721"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2722"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a0b41f0434b3f10219bfbfc0ae02d60a0" kindref="member">HIGH_CURRENT_DRIVE</ref>;</highlight></codeline>
<codeline lineno="2723"><highlight class="normal"></highlight></codeline>
<codeline lineno="2724"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a5117b50c00668aff73b5df385b0fc5f8" kindref="member">in_is_isochronous</ref><sp/>==<sp/>1)</highlight></codeline>
<codeline lineno="2725"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>|=<sp/>0x1;</highlight></codeline>
<codeline lineno="2726"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2727"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>&amp;=<sp/>~0x1;</highlight></codeline>
<codeline lineno="2728"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab9885ee665c318a8d19c28a9c75b999a" kindref="member">out_is_isochronous</ref><sp/>==<sp/>1)</highlight></codeline>
<codeline lineno="2729"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>|=<sp/>0x2;</highlight></codeline>
<codeline lineno="2730"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2731"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>&amp;=<sp/>~0x2;</highlight></codeline>
<codeline lineno="2732"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a722a630d370318cefa94de1365f98786" kindref="member">suspend_pull_downs</ref><sp/>==<sp/>1)</highlight></codeline>
<codeline lineno="2733"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>|=<sp/>0x4;</highlight></codeline>
<codeline lineno="2734"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2735"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>&amp;=<sp/>~0x4;</highlight></codeline>
<codeline lineno="2736"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a54772c4686e082384adee26eeaa68005" kindref="member">use_usb_version</ref><sp/>==<sp/><ref refid="ftdi_8h_1ae6a585cfccd26ea11cb195877d49b211" kindref="member">USE_USB_VERSION_BIT</ref>)</highlight></codeline>
<codeline lineno="2737"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>|=<sp/><ref refid="ftdi_8h_1ae6a585cfccd26ea11cb195877d49b211" kindref="member">USE_USB_VERSION_BIT</ref>;</highlight></codeline>
<codeline lineno="2738"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2739"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1ae6a585cfccd26ea11cb195877d49b211" kindref="member">USE_USB_VERSION_BIT</ref>;</highlight></codeline>
<codeline lineno="2740"><highlight class="normal"></highlight></codeline>
<codeline lineno="2741"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0C]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" kindref="member">usb_version</ref><sp/>&amp;<sp/>0xff;</highlight></codeline>
<codeline lineno="2742"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0D]<sp/>=<sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" kindref="member">usb_version</ref>&gt;&gt;8)<sp/>&amp;<sp/>0xff;</highlight></codeline>
<codeline lineno="2743"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x14]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref>;</highlight></codeline>
<codeline lineno="2744"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2745"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>:</highlight></codeline>
<codeline lineno="2746"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ad377261e985c768c2ca5731e9690efd9" kindref="member">high_current</ref><sp/>==<sp/><ref refid="ftdi_8h_1adce93ce221bc8772e8149981be6ee5a7" kindref="member">HIGH_CURRENT_DRIVE_R</ref>)</highlight></codeline>
<codeline lineno="2747"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>|=<sp/><ref refid="ftdi_8h_1adce93ce221bc8772e8149981be6ee5a7" kindref="member">HIGH_CURRENT_DRIVE_R</ref>;</highlight></codeline>
<codeline lineno="2748"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>=<sp/>0x40;<sp/></highlight><highlight class="comment">/*<sp/>Hard<sp/>coded<sp/>Endpoint<sp/>Size*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2749"><highlight class="normal"></highlight></codeline>
<codeline lineno="2750"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a722a630d370318cefa94de1365f98786" kindref="member">suspend_pull_downs</ref><sp/>==<sp/>1)</highlight></codeline>
<codeline lineno="2751"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>|=<sp/>0x4;</highlight></codeline>
<codeline lineno="2752"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2753"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>&amp;=<sp/>~0x4;</highlight></codeline>
<codeline lineno="2754"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0B]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a4876d3d01242d7c3b2961b1a42b35509" kindref="member">invert</ref>;</highlight></codeline>
<codeline lineno="2755"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0C]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" kindref="member">usb_version</ref><sp/>&amp;<sp/>0xff;</highlight></codeline>
<codeline lineno="2756"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0D]<sp/>=<sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" kindref="member">usb_version</ref>&gt;&gt;8)<sp/>&amp;<sp/>0xff;</highlight></codeline>
<codeline lineno="2757"><highlight class="normal"></highlight></codeline>
<codeline lineno="2758"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[0]<sp/>&gt;<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a192d6684008401d4be18a17cab683741" kindref="member">CBUS_BB</ref>)</highlight></codeline>
<codeline lineno="2759"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x14]<sp/>=<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a0951f6293488ba4fa6cccde4c3acc7dd" kindref="member">CBUS_TXLED</ref>;</highlight></codeline>
<codeline lineno="2760"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2761"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x14]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[0];</highlight></codeline>
<codeline lineno="2762"><highlight class="normal"></highlight></codeline>
<codeline lineno="2763"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[1]<sp/>&gt;<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a192d6684008401d4be18a17cab683741" kindref="member">CBUS_BB</ref>)</highlight></codeline>
<codeline lineno="2764"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x14]<sp/>|=<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a6843d248e73c2282a3f1554afec757ea" kindref="member">CBUS_RXLED</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2765"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2766"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x14]<sp/>|=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[1]&lt;&lt;4;</highlight></codeline>
<codeline lineno="2767"><highlight class="normal"></highlight></codeline>
<codeline lineno="2768"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[2]<sp/>&gt;<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a192d6684008401d4be18a17cab683741" kindref="member">CBUS_BB</ref>)</highlight></codeline>
<codeline lineno="2769"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x15]<sp/>=<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a82dad8e9b80ece6a5924b7cccb4825de" kindref="member">CBUS_TXDEN</ref>;</highlight></codeline>
<codeline lineno="2770"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2771"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x15]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[2];</highlight></codeline>
<codeline lineno="2772"><highlight class="normal"></highlight></codeline>
<codeline lineno="2773"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[3]<sp/>&gt;<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a192d6684008401d4be18a17cab683741" kindref="member">CBUS_BB</ref>)</highlight></codeline>
<codeline lineno="2774"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x15]<sp/>|=<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a1315b5812fad8f70ec7d1a9b7c30533b" kindref="member">CBUS_PWREN</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2775"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2776"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x15]<sp/>|=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[3]&lt;&lt;4;</highlight></codeline>
<codeline lineno="2777"><highlight class="normal"></highlight></codeline>
<codeline lineno="2778"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[4]<sp/>&gt;<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2ae8a6b1ed842c6c54b8251e2579a3fd98" kindref="member">CBUS_CLK6</ref>)</highlight></codeline>
<codeline lineno="2779"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x16]<sp/>=<sp/><ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a1316ff4aa58d6b250d3a8d1e61d2afef" kindref="member">CBUS_SLEEP</ref>;</highlight></codeline>
<codeline lineno="2780"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2781"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x16]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[4];</highlight></codeline>
<codeline lineno="2782"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2783"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>:</highlight></codeline>
<codeline lineno="2784"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>=<sp/>type2bit(eeprom-&gt;<ref refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" kindref="member">channel_a_type</ref>,<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>);</highlight></codeline>
<codeline lineno="2785"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" kindref="member">channel_a_driver</ref><sp/>==<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>)</highlight></codeline>
<codeline lineno="2786"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>|=<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="2787"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2788"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="2789"><highlight class="normal"></highlight></codeline>
<codeline lineno="2790"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>=<sp/>type2bit(eeprom-&gt;<ref refid="structftdi__eeprom_1a2da524307ba5904880ba6e2456adc4c1" kindref="member">channel_b_type</ref>,<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>);</highlight></codeline>
<codeline lineno="2791"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a128def5dc4387fdcdaddaa7c9f460637" kindref="member">channel_b_driver</ref><sp/>==<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>)</highlight></codeline>
<codeline lineno="2792"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>|=<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="2793"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2794"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="2795"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1afc46f39449462d10f9b8992523214136" kindref="member">suspend_dbus7</ref><sp/>==<sp/><ref refid="ftdi_8h_1ada79600bc57b36a0ab93a8fbd834b8b9" kindref="member">SUSPEND_DBUS7_BIT</ref>)</highlight></codeline>
<codeline lineno="2796"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>|=<sp/><ref refid="ftdi_8h_1ada79600bc57b36a0ab93a8fbd834b8b9" kindref="member">SUSPEND_DBUS7_BIT</ref>;</highlight></codeline>
<codeline lineno="2797"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2798"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1ada79600bc57b36a0ab93a8fbd834b8b9" kindref="member">SUSPEND_DBUS7_BIT</ref>;</highlight></codeline>
<codeline lineno="2799"><highlight class="normal"></highlight></codeline>
<codeline lineno="2800"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a722a630d370318cefa94de1365f98786" kindref="member">suspend_pull_downs</ref><sp/>==<sp/>1)</highlight></codeline>
<codeline lineno="2801"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>|=<sp/>0x4;</highlight></codeline>
<codeline lineno="2802"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2803"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0A]<sp/>&amp;=<sp/>~0x4;</highlight></codeline>
<codeline lineno="2804"><highlight class="normal"></highlight></codeline>
<codeline lineno="2805"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" kindref="member">group0_drive</ref><sp/>&gt;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>)</highlight></codeline>
<codeline lineno="2806"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>;</highlight></codeline>
<codeline lineno="2807"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2808"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" kindref="member">group0_drive</ref>;</highlight></codeline>
<codeline lineno="2809"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" kindref="member">group0_schmitt</ref><sp/>==<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>)</highlight></codeline>
<codeline lineno="2810"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>;</highlight></codeline>
<codeline lineno="2811"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" kindref="member">group0_slew</ref><sp/>==<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>)</highlight></codeline>
<codeline lineno="2812"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>;</highlight></codeline>
<codeline lineno="2813"><highlight class="normal"></highlight></codeline>
<codeline lineno="2814"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" kindref="member">group1_drive</ref><sp/>&gt;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>)</highlight></codeline>
<codeline lineno="2815"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2816"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2817"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" kindref="member">group1_drive</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2818"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" kindref="member">group1_schmitt</ref><sp/>==<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>)</highlight></codeline>
<codeline lineno="2819"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2820"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" kindref="member">group1_slew</ref><sp/>==<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>)</highlight></codeline>
<codeline lineno="2821"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2822"><highlight class="normal"></highlight></codeline>
<codeline lineno="2823"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a58cb0545a65f6f0bf431e186f1b44f71" kindref="member">group2_drive</ref><sp/>&gt;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>)</highlight></codeline>
<codeline lineno="2824"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>;</highlight></codeline>
<codeline lineno="2825"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2826"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a58cb0545a65f6f0bf431e186f1b44f71" kindref="member">group2_drive</ref>;</highlight></codeline>
<codeline lineno="2827"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aa6c5c7b16e649d70e358b021ad0c469e" kindref="member">group2_schmitt</ref><sp/>==<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>)</highlight></codeline>
<codeline lineno="2828"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>;</highlight></codeline>
<codeline lineno="2829"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab69800fef64ca3d55449eab4322e5090" kindref="member">group2_slew</ref><sp/>==<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>)</highlight></codeline>
<codeline lineno="2830"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>;</highlight></codeline>
<codeline lineno="2831"><highlight class="normal"></highlight></codeline>
<codeline lineno="2832"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ae5c54d334e18338296557572deee7433" kindref="member">group3_drive</ref><sp/>&gt;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>)</highlight></codeline>
<codeline lineno="2833"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2834"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2835"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ae5c54d334e18338296557572deee7433" kindref="member">group3_drive</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2836"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a7afc69623874f8b64614f2688f08033e" kindref="member">group3_schmitt</ref><sp/>==<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>)</highlight></codeline>
<codeline lineno="2837"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2838"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a13e5b314e0a2c1e0a67f6bb31ac07f5a" kindref="member">group3_slew</ref><sp/>==<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>)</highlight></codeline>
<codeline lineno="2839"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2840"><highlight class="normal"></highlight></codeline>
<codeline lineno="2841"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x18]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref>;</highlight></codeline>
<codeline lineno="2842"><highlight class="normal"></highlight></codeline>
<codeline lineno="2843"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2844"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref>:</highlight></codeline>
<codeline lineno="2845"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" kindref="member">channel_a_driver</ref><sp/>==<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>)</highlight></codeline>
<codeline lineno="2846"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>|=<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="2847"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2848"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="2849"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a128def5dc4387fdcdaddaa7c9f460637" kindref="member">channel_b_driver</ref><sp/>==<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>)</highlight></codeline>
<codeline lineno="2850"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>|=<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="2851"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2852"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="2853"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ae08edaf6d0e878a3f9e08e428ac1612d" kindref="member">channel_c_driver</ref><sp/>==<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>)</highlight></codeline>
<codeline lineno="2854"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>|=<sp/>(<ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref><sp/>&lt;&lt;<sp/>4);</highlight></codeline>
<codeline lineno="2855"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2856"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>&amp;=<sp/>~(<ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref><sp/>&lt;&lt;<sp/>4);</highlight></codeline>
<codeline lineno="2857"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aea0a7b1821735930d82f24f5f0b6a006" kindref="member">channel_d_driver</ref><sp/>==<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>)</highlight></codeline>
<codeline lineno="2858"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>|=<sp/>(<ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref><sp/>&lt;&lt;<sp/>4);</highlight></codeline>
<codeline lineno="2859"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2860"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>&amp;=<sp/>~(<ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref><sp/>&lt;&lt;<sp/>4);</highlight></codeline>
<codeline lineno="2861"><highlight class="normal"></highlight></codeline>
<codeline lineno="2862"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a722a630d370318cefa94de1365f98786" kindref="member">suspend_pull_downs</ref><sp/>==<sp/>1)</highlight></codeline>
<codeline lineno="2863"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0a]<sp/>|=<sp/>0x4;</highlight></codeline>
<codeline lineno="2864"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2865"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0a]<sp/>&amp;=<sp/>~0x4;</highlight></codeline>
<codeline lineno="2866"><highlight class="normal"></highlight></codeline>
<codeline lineno="2867"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac26b22453035924c2149689b07f8fae8" kindref="member">channel_a_rs485enable</ref>)</highlight></codeline>
<codeline lineno="2868"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0b]<sp/>|=<sp/><ref refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" kindref="member">CHANNEL_IS_RS485</ref><sp/>&lt;&lt;<sp/>0;</highlight></codeline>
<codeline lineno="2869"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2870"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0b]<sp/>&amp;=<sp/>~(<ref refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" kindref="member">CHANNEL_IS_RS485</ref><sp/>&lt;&lt;<sp/>0);</highlight></codeline>
<codeline lineno="2871"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aec61d454c0f8bc1c810aa5682e9fe12a" kindref="member">channel_b_rs485enable</ref>)</highlight></codeline>
<codeline lineno="2872"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0b]<sp/>|=<sp/><ref refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" kindref="member">CHANNEL_IS_RS485</ref><sp/>&lt;&lt;<sp/>1;</highlight></codeline>
<codeline lineno="2873"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2874"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0b]<sp/>&amp;=<sp/>~(<ref refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" kindref="member">CHANNEL_IS_RS485</ref><sp/>&lt;&lt;<sp/>1);</highlight></codeline>
<codeline lineno="2875"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a2c8f96a24402a0f8b8a4e9b34f137142" kindref="member">channel_c_rs485enable</ref>)</highlight></codeline>
<codeline lineno="2876"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0b]<sp/>|=<sp/><ref refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" kindref="member">CHANNEL_IS_RS485</ref><sp/>&lt;&lt;<sp/>2;</highlight></codeline>
<codeline lineno="2877"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2878"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0b]<sp/>&amp;=<sp/>~(<ref refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" kindref="member">CHANNEL_IS_RS485</ref><sp/>&lt;&lt;<sp/>2);</highlight></codeline>
<codeline lineno="2879"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a6b073acb642e6053c74ec2238942adb4" kindref="member">channel_d_rs485enable</ref>)</highlight></codeline>
<codeline lineno="2880"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0b]<sp/>|=<sp/><ref refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" kindref="member">CHANNEL_IS_RS485</ref><sp/>&lt;&lt;<sp/>3;</highlight></codeline>
<codeline lineno="2881"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2882"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0b]<sp/>&amp;=<sp/>~(<ref refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" kindref="member">CHANNEL_IS_RS485</ref><sp/>&lt;&lt;<sp/>3);</highlight></codeline>
<codeline lineno="2883"><highlight class="normal"></highlight></codeline>
<codeline lineno="2884"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" kindref="member">group0_drive</ref><sp/>&gt;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>)</highlight></codeline>
<codeline lineno="2885"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>;</highlight></codeline>
<codeline lineno="2886"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2887"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" kindref="member">group0_drive</ref>;</highlight></codeline>
<codeline lineno="2888"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" kindref="member">group0_schmitt</ref><sp/>==<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>)</highlight></codeline>
<codeline lineno="2889"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>;</highlight></codeline>
<codeline lineno="2890"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" kindref="member">group0_slew</ref><sp/>==<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>)</highlight></codeline>
<codeline lineno="2891"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>;</highlight></codeline>
<codeline lineno="2892"><highlight class="normal"></highlight></codeline>
<codeline lineno="2893"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" kindref="member">group1_drive</ref><sp/>&gt;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>)</highlight></codeline>
<codeline lineno="2894"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2895"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2896"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" kindref="member">group1_drive</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2897"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" kindref="member">group1_schmitt</ref><sp/>==<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>)</highlight></codeline>
<codeline lineno="2898"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2899"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" kindref="member">group1_slew</ref><sp/>==<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>)</highlight></codeline>
<codeline lineno="2900"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2901"><highlight class="normal"></highlight></codeline>
<codeline lineno="2902"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a58cb0545a65f6f0bf431e186f1b44f71" kindref="member">group2_drive</ref><sp/>&gt;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>)</highlight></codeline>
<codeline lineno="2903"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>;</highlight></codeline>
<codeline lineno="2904"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2905"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a58cb0545a65f6f0bf431e186f1b44f71" kindref="member">group2_drive</ref>;</highlight></codeline>
<codeline lineno="2906"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aa6c5c7b16e649d70e358b021ad0c469e" kindref="member">group2_schmitt</ref><sp/>==<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>)</highlight></codeline>
<codeline lineno="2907"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>;</highlight></codeline>
<codeline lineno="2908"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab69800fef64ca3d55449eab4322e5090" kindref="member">group2_slew</ref><sp/>==<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>)</highlight></codeline>
<codeline lineno="2909"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>;</highlight></codeline>
<codeline lineno="2910"><highlight class="normal"></highlight></codeline>
<codeline lineno="2911"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ae5c54d334e18338296557572deee7433" kindref="member">group3_drive</ref><sp/>&gt;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>)</highlight></codeline>
<codeline lineno="2912"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2913"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2914"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ae5c54d334e18338296557572deee7433" kindref="member">group3_drive</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2915"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a7afc69623874f8b64614f2688f08033e" kindref="member">group3_schmitt</ref><sp/>==<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>)</highlight></codeline>
<codeline lineno="2916"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2917"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a13e5b314e0a2c1e0a67f6bb31ac07f5a" kindref="member">group3_slew</ref><sp/>==<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>)</highlight></codeline>
<codeline lineno="2918"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>&lt;&lt;4;</highlight></codeline>
<codeline lineno="2919"><highlight class="normal"></highlight></codeline>
<codeline lineno="2920"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x18]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref>;</highlight></codeline>
<codeline lineno="2921"><highlight class="normal"></highlight></codeline>
<codeline lineno="2922"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2923"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>:</highlight></codeline>
<codeline lineno="2924"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>=<sp/>type2bit(eeprom-&gt;<ref refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" kindref="member">channel_a_type</ref>,<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>);</highlight></codeline>
<codeline lineno="2925"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" kindref="member">channel_a_driver</ref><sp/>==<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>)</highlight></codeline>
<codeline lineno="2926"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>|=<sp/><ref refid="ftdi_8h_1a5da3119ded0e1994a3d4fcd78da2eb6c" kindref="member">DRIVER_VCPH</ref>;</highlight></codeline>
<codeline lineno="2927"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2928"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x00]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a5da3119ded0e1994a3d4fcd78da2eb6c" kindref="member">DRIVER_VCPH</ref>;</highlight></codeline>
<codeline lineno="2929"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1acbaa0dac427977d4f8fcd735a34bf2c3" kindref="member">powersave</ref>)</highlight></codeline>
<codeline lineno="2930"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>|=<sp/><ref refid="ftdi_8h_1a7fe7b5606c0cc443ec8813a562e3c6ca" kindref="member">POWER_SAVE_DISABLE_H</ref>;</highlight></codeline>
<codeline lineno="2931"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2932"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a7fe7b5606c0cc443ec8813a562e3c6ca" kindref="member">POWER_SAVE_DISABLE_H</ref>;</highlight></codeline>
<codeline lineno="2933"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a55c072e8789a611a3842296ca1ac5171" kindref="member">clock_polarity</ref>)</highlight></codeline>
<codeline lineno="2934"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>|=<sp/><ref refid="ftdi_8h_1a1a6dd2fedbead82493fd1d8fbf702c91" kindref="member">FT1284_CLK_IDLE_STATE</ref>;</highlight></codeline>
<codeline lineno="2935"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2936"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a1a6dd2fedbead82493fd1d8fbf702c91" kindref="member">FT1284_CLK_IDLE_STATE</ref>;</highlight></codeline>
<codeline lineno="2937"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a8a1f5de674bbd131e42e924ead65c617" kindref="member">data_order</ref>)</highlight></codeline>
<codeline lineno="2938"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>|=<sp/><ref refid="ftdi_8h_1a5b08fd32976ca0ba42f66832fdb19a8b" kindref="member">FT1284_DATA_LSB</ref>;</highlight></codeline>
<codeline lineno="2939"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2940"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a5b08fd32976ca0ba42f66832fdb19a8b" kindref="member">FT1284_DATA_LSB</ref>;</highlight></codeline>
<codeline lineno="2941"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a85d03dc6aa088d929eea3c7b6b7c5741" kindref="member">flow_control</ref>)</highlight></codeline>
<codeline lineno="2942"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>|=<sp/><ref refid="ftdi_8h_1a92220e6661b8fa1d8eac57fda958239c" kindref="member">FT1284_FLOW_CONTROL</ref>;</highlight></codeline>
<codeline lineno="2943"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2944"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x01]<sp/>&amp;=<sp/>~<ref refid="ftdi_8h_1a92220e6661b8fa1d8eac57fda958239c" kindref="member">FT1284_FLOW_CONTROL</ref>;</highlight></codeline>
<codeline lineno="2945"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" kindref="member">group0_drive</ref><sp/>&gt;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>)</highlight></codeline>
<codeline lineno="2946"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>;</highlight></codeline>
<codeline lineno="2947"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2948"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" kindref="member">group0_drive</ref>;</highlight></codeline>
<codeline lineno="2949"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" kindref="member">group0_schmitt</ref><sp/>==<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>)</highlight></codeline>
<codeline lineno="2950"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>;</highlight></codeline>
<codeline lineno="2951"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" kindref="member">group0_slew</ref><sp/>==<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>)</highlight></codeline>
<codeline lineno="2952"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0c]<sp/>|=<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>;</highlight></codeline>
<codeline lineno="2953"><highlight class="normal"></highlight></codeline>
<codeline lineno="2954"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" kindref="member">group1_drive</ref><sp/>&gt;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>)</highlight></codeline>
<codeline lineno="2955"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>;</highlight></codeline>
<codeline lineno="2956"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2957"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" kindref="member">group1_drive</ref>;</highlight></codeline>
<codeline lineno="2958"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" kindref="member">group1_schmitt</ref><sp/>==<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>)</highlight></codeline>
<codeline lineno="2959"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>;</highlight></codeline>
<codeline lineno="2960"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" kindref="member">group1_slew</ref><sp/>==<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>)</highlight></codeline>
<codeline lineno="2961"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x0d]<sp/>|=<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>;</highlight></codeline>
<codeline lineno="2962"><highlight class="normal"></highlight></codeline>
<codeline lineno="2963"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga4c5f8b615c0db9ed6deefaf57563e3f5" kindref="member">set_ft232h_cbus</ref>(eeprom,<sp/>output);</highlight></codeline>
<codeline lineno="2964"><highlight class="normal"></highlight></codeline>
<codeline lineno="2965"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>output[0x1e]<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref>;</highlight></codeline>
<codeline lineno="2966"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stderr,</highlight><highlight class="stringliteral">&quot;FIXME:<sp/>Build<sp/>FT232H<sp/>specific<sp/>EEPROM<sp/>settings\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="2967"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="2968"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="2969"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2970"><highlight class="normal"></highlight></codeline>
<codeline lineno="2971"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>calculate<sp/>checksum</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2972"><highlight class="normal"><sp/><sp/><sp/><sp/>checksum<sp/>=<sp/>0xAAAA;</highlight></codeline>
<codeline lineno="2973"><highlight class="normal"></highlight></codeline>
<codeline lineno="2974"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref>/2-1;<sp/>i++)</highlight></codeline>
<codeline lineno="2975"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2976"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>=<sp/>output[i*2];</highlight></codeline>
<codeline lineno="2977"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>+=<sp/>output[(i*2)+1]<sp/>&lt;&lt;<sp/>8;</highlight></codeline>
<codeline lineno="2978"><highlight class="normal"></highlight></codeline>
<codeline lineno="2979"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>checksum<sp/>=<sp/>value^checksum;</highlight></codeline>
<codeline lineno="2980"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>checksum<sp/>=<sp/>(checksum<sp/>&lt;&lt;<sp/>1)<sp/>|<sp/>(checksum<sp/>&gt;&gt;<sp/>15);</highlight></codeline>
<codeline lineno="2981"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="2982"><highlight class="normal"></highlight></codeline>
<codeline lineno="2983"><highlight class="normal"><sp/><sp/><sp/><sp/>output[eeprom-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref>-2]<sp/>=<sp/>checksum;</highlight></codeline>
<codeline lineno="2984"><highlight class="normal"><sp/><sp/><sp/><sp/>output[eeprom-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref>-1]<sp/>=<sp/>checksum<sp/>&gt;&gt;<sp/>8;</highlight></codeline>
<codeline lineno="2985"><highlight class="normal"></highlight></codeline>
<codeline lineno="2986"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>user_area_size;</highlight></codeline>
<codeline lineno="2987"><highlight class="normal">}</highlight></codeline>
<codeline lineno="2988"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Decode<sp/>the<sp/>encoded<sp/>EEPROM<sp/>field<sp/>for<sp/>the<sp/>FTDI<sp/>Mode<sp/>into<sp/>a<sp/>value<sp/>for<sp/>the<sp/>abstracted<sp/></highlight></codeline>
<codeline lineno="2989"><highlight class="comment"><sp/>*<sp/>EEPROM<sp/>structure</highlight></codeline>
<codeline lineno="2990"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="2991"><highlight class="comment"><sp/>*<sp/>FTD2XX<sp/>doesn&apos;t<sp/>allow<sp/>to<sp/>set<sp/>multiple<sp/>bits<sp/>in<sp/>the<sp/>interface<sp/>mode<sp/>bitfield,<sp/>and<sp/>so<sp/>do<sp/>we</highlight></codeline>
<codeline lineno="2992"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2993"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>bit2type(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>bits)</highlight></codeline>
<codeline lineno="2994"><highlight class="normal">{</highlight></codeline>
<codeline lineno="2995"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(bits)</highlight></codeline>
<codeline lineno="2996"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="2997"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><sp/><sp/>0:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ae5cad0e9c60b369bffd8183c8ea2b9b2" kindref="member">CHANNEL_IS_UART</ref>;</highlight></codeline>
<codeline lineno="2998"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><sp/><sp/>1:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1af78e3df1428821d0f91aec62b1c26805" kindref="member">CHANNEL_IS_FIFO</ref>;</highlight></codeline>
<codeline lineno="2999"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><sp/><sp/>2:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1aadc4e0dc12a87ef1d2bf7234330bec75" kindref="member">CHANNEL_IS_OPTO</ref>;</highlight></codeline>
<codeline lineno="3000"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><sp/><sp/>4:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a7b1430e3f1529193e10fa64ea0f156a9" kindref="member">CHANNEL_IS_CPU</ref>;</highlight></codeline>
<codeline lineno="3001"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><sp/><sp/>8:<sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a4ade952468d6ba7278c9d27dd73e2f03" kindref="member">CHANNEL_IS_FT1284</ref>;</highlight></codeline>
<codeline lineno="3002"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="3003"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stderr,</highlight><highlight class="stringliteral">&quot;<sp/>Unexpected<sp/>value<sp/>%d<sp/>for<sp/>Hardware<sp/>Interface<sp/>type\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3004"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>bits);</highlight></codeline>
<codeline lineno="3005"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3006"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="3007"><highlight class="normal">}</highlight></codeline>
<codeline lineno="3020" refid="group__libftdi_1gac91c95ae42ec1ba885dc54f39709c072" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gac91c95ae42ec1ba885dc54f39709c072" kindref="member">ftdi_eeprom_decode</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>verbose)</highlight></codeline>
<codeline lineno="3021"><highlight class="normal">{</highlight></codeline>
<codeline lineno="3022"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>i,<sp/>j;</highlight></codeline>
<codeline lineno="3023"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>checksum,<sp/>eeprom_checksum,<sp/>value;</highlight></codeline>
<codeline lineno="3024"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>manufacturer_size<sp/>=<sp/>0,<sp/>product_size<sp/>=<sp/>0,<sp/>serial_size<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="3025"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>eeprom_size;</highlight></codeline>
<codeline lineno="3026"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structftdi__eeprom" kindref="compound" tooltip="FTDI eeprom structure.">ftdi_eeprom</ref><sp/>*eeprom;</highlight></codeline>
<codeline lineno="3027"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<ref refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" kindref="member">buf</ref><sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" kindref="member">buf</ref>;</highlight></codeline>
<codeline lineno="3028"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>release;</highlight></codeline>
<codeline lineno="3029"><highlight class="normal"></highlight></codeline>
<codeline lineno="3030"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="3031"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,</highlight><highlight class="stringliteral">&quot;No<sp/>context&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3032"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="3033"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,</highlight><highlight class="stringliteral">&quot;No<sp/>eeprom<sp/>structure&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3034"><highlight class="normal"></highlight></codeline>
<codeline lineno="3035"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>;</highlight></codeline>
<codeline lineno="3036"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom_size<sp/>=<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref>;</highlight></codeline>
<codeline lineno="3037"><highlight class="normal"></highlight></codeline>
<codeline lineno="3038"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>02:<sp/>Vendor<sp/>ID</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3039"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1af591e992b9bd12a484ea9d4d36e92251" kindref="member">vendor_id</ref><sp/>=<sp/>buf[0x02]<sp/>+<sp/>(buf[0x03]<sp/>&lt;&lt;<sp/>8);</highlight></codeline>
<codeline lineno="3040"><highlight class="normal"></highlight></codeline>
<codeline lineno="3041"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>04:<sp/>Product<sp/>ID</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3042"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" kindref="member">product_id</ref><sp/>=<sp/>buf[0x04]<sp/>+<sp/>(buf[0x05]<sp/>&lt;&lt;<sp/>8);</highlight></codeline>
<codeline lineno="3043"><highlight class="normal"></highlight></codeline>
<codeline lineno="3044"><highlight class="normal"><sp/><sp/><sp/><sp/>release<sp/>=<sp/>buf[0x06]<sp/>+<sp/>(buf[0x07]&lt;&lt;8);</highlight></codeline>
<codeline lineno="3045"><highlight class="normal"></highlight></codeline>
<codeline lineno="3046"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>08:<sp/>Config<sp/>descriptor</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3047"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>7:<sp/>always<sp/>1</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3048"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>6:<sp/>1<sp/>if<sp/>this<sp/>device<sp/>is<sp/>self<sp/>powered,<sp/>0<sp/>if<sp/>bus<sp/>powered</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3049"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>5:<sp/>1<sp/>if<sp/>this<sp/>device<sp/>uses<sp/>remote<sp/>wakeup</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3050"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a055d6bef2328557e6ac4d2909e42d21b" kindref="member">self_powered</ref><sp/>=<sp/>buf[0x08]<sp/>&amp;<sp/>0x40;</highlight></codeline>
<codeline lineno="3051"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a9b82f88497b432bebfa4dd92c304cb02" kindref="member">remote_wakeup</ref><sp/>=<sp/>buf[0x08]<sp/>&amp;<sp/>0x20;</highlight></codeline>
<codeline lineno="3052"><highlight class="normal"></highlight></codeline>
<codeline lineno="3053"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>09:<sp/>Max<sp/>power<sp/>consumption:<sp/>max<sp/>power<sp/>=<sp/>value<sp/>*<sp/>2<sp/>mA</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3054"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a8aa39af43a6ac5c05b8682d8b3904e3c" kindref="member">max_power</ref><sp/>=<sp/><ref refid="ftdi__i_8h_1ad4d084064eecf35f2bcaeae257f9d517" kindref="member">MAX_POWER_MILLIAMP_PER_UNIT</ref><sp/>*<sp/>buf[0x09];</highlight></codeline>
<codeline lineno="3055"><highlight class="normal"></highlight></codeline>
<codeline lineno="3056"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>0A:<sp/>Chip<sp/>configuration</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3057"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>7:<sp/>0<sp/>-<sp/>reserved</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3058"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>6:<sp/>0<sp/>-<sp/>reserved</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3059"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>5:<sp/>0<sp/>-<sp/>reserved</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3060"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>4:<sp/>1<sp/>-<sp/>Change<sp/>USB<sp/>version<sp/>on<sp/>BM<sp/>and<sp/>2232C</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3061"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>3:<sp/>1<sp/>-<sp/>Use<sp/>the<sp/>serial<sp/>number<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3062"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>2:<sp/>1<sp/>-<sp/>Enable<sp/>suspend<sp/>pull<sp/>downs<sp/>for<sp/>lower<sp/>power</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3063"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>1:<sp/>1<sp/>-<sp/>Out<sp/>EndPoint<sp/>is<sp/>Isochronous</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3064"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Bit<sp/>0:<sp/>1<sp/>-<sp/>In<sp/>EndPoint<sp/>is<sp/>Isochronous</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3065"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3066"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a5117b50c00668aff73b5df385b0fc5f8" kindref="member">in_is_isochronous</ref><sp/><sp/>=<sp/>buf[0x0A]&amp;0x01;</highlight></codeline>
<codeline lineno="3067"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab9885ee665c318a8d19c28a9c75b999a" kindref="member">out_is_isochronous</ref><sp/>=<sp/>buf[0x0A]&amp;0x02;</highlight></codeline>
<codeline lineno="3068"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a722a630d370318cefa94de1365f98786" kindref="member">suspend_pull_downs</ref><sp/>=<sp/>buf[0x0A]&amp;0x04;</highlight></codeline>
<codeline lineno="3069"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1abe250275595d020fd8de3aa61d093d38" kindref="member">use_serial</ref><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>(buf[0x0A]<sp/>&amp;<sp/><ref refid="ftdi_8h_1a100304658f531729f8961ac2b5609fb1" kindref="member">USE_SERIAL_NUM</ref>)?1:0;</highlight></codeline>
<codeline lineno="3070"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a54772c4686e082384adee26eeaa68005" kindref="member">use_usb_version</ref><sp/><sp/><sp/><sp/>=<sp/>buf[0x0A]<sp/>&amp;<sp/><ref refid="ftdi_8h_1ae6a585cfccd26ea11cb195877d49b211" kindref="member">USE_USB_VERSION_BIT</ref>;</highlight></codeline>
<codeline lineno="3071"><highlight class="normal"></highlight></codeline>
<codeline lineno="3072"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>0C:<sp/>USB<sp/>version<sp/>low<sp/>byte<sp/>when<sp/>0x0A</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3073"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>0D:<sp/>USB<sp/>version<sp/>high<sp/>byte<sp/>when<sp/>0x0A</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3074"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" kindref="member">usb_version</ref><sp/>=<sp/>buf[0x0C]<sp/>+<sp/>(buf[0x0D]<sp/>&lt;&lt;<sp/>8);</highlight></codeline>
<codeline lineno="3075"><highlight class="normal"></highlight></codeline>
<codeline lineno="3076"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>0E:<sp/>Offset<sp/>of<sp/>the<sp/>manufacturer<sp/>string<sp/>+<sp/>0x80,<sp/>calculated<sp/>later</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3077"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>0F:<sp/>Length<sp/>of<sp/>manufacturer<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3078"><highlight class="normal"><sp/><sp/><sp/><sp/>manufacturer_size<sp/>=<sp/>buf[0x0F]/2;</highlight></codeline>
<codeline lineno="3079"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>)</highlight></codeline>
<codeline lineno="3080"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>);</highlight></codeline>
<codeline lineno="3081"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(manufacturer_size<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="3082"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3083"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref><sp/>=<sp/>malloc(manufacturer_size);</highlight></codeline>
<codeline lineno="3084"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>)</highlight></codeline>
<codeline lineno="3085"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3086"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Decode<sp/>manufacturer</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3087"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/>=<sp/>buf[0x0E]<sp/>&amp;<sp/>(eeprom_size<sp/>-1);<sp/></highlight><highlight class="comment">//<sp/>offset</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3088"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;j&lt;manufacturer_size-1;j++)</highlight></codeline>
<codeline lineno="3089"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3090"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>[j]<sp/>=<sp/>buf[2*j+i+2];</highlight></codeline>
<codeline lineno="3091"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3092"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>[j]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3093"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3094"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3095"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="3096"><highlight class="normal"></highlight></codeline>
<codeline lineno="3097"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>10:<sp/>Offset<sp/>of<sp/>the<sp/>product<sp/>string<sp/>+<sp/>0x80,<sp/>calculated<sp/>later</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3098"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>11:<sp/>Length<sp/>of<sp/>product<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3099"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>)</highlight></codeline>
<codeline lineno="3100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>);</highlight></codeline>
<codeline lineno="3101"><highlight class="normal"><sp/><sp/><sp/><sp/>product_size<sp/>=<sp/>buf[0x11]/2;</highlight></codeline>
<codeline lineno="3102"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(product_size<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="3103"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref><sp/>=<sp/>malloc(product_size);</highlight></codeline>
<codeline lineno="3105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>)</highlight></codeline>
<codeline lineno="3106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Decode<sp/>product<sp/>name</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3108"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/>=<sp/>buf[0x10]<sp/>&amp;<sp/>(eeprom_size<sp/>-1);<sp/></highlight><highlight class="comment">//<sp/>offset</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;j&lt;product_size-1;j++)</highlight></codeline>
<codeline lineno="3110"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3111"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>[j]<sp/>=<sp/>buf[2*j+i+2];</highlight></codeline>
<codeline lineno="3112"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3113"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>[j]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3114"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3115"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3116"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="3117"><highlight class="normal"></highlight></codeline>
<codeline lineno="3118"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>12:<sp/>Offset<sp/>of<sp/>the<sp/>serial<sp/>string<sp/>+<sp/>0x80,<sp/>calculated<sp/>later</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3119"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>13:<sp/>Length<sp/>of<sp/>serial<sp/>string</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3120"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>)</highlight></codeline>
<codeline lineno="3121"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>free(eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>);</highlight></codeline>
<codeline lineno="3122"><highlight class="normal"><sp/><sp/><sp/><sp/>serial_size<sp/>=<sp/>buf[0x13]/2;</highlight></codeline>
<codeline lineno="3123"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(serial_size<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="3124"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref><sp/>=<sp/>malloc(serial_size);</highlight></codeline>
<codeline lineno="3126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>)</highlight></codeline>
<codeline lineno="3127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3128"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Decode<sp/>serial</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>i<sp/>=<sp/>buf[0x12]<sp/>&amp;<sp/>(eeprom_size<sp/>-1);<sp/></highlight><highlight class="comment">//<sp/>offset</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3130"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(j=0;j&lt;serial_size-1;j++)</highlight></codeline>
<codeline lineno="3131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>[j]<sp/>=<sp/>buf[2*j+i+2];</highlight></codeline>
<codeline lineno="3133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>[j]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3136"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3137"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref><sp/>=<sp/>NULL;</highlight></codeline>
<codeline lineno="3138"><highlight class="normal"></highlight></codeline>
<codeline lineno="3139"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>verify<sp/>checksum</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3140"><highlight class="normal"><sp/><sp/><sp/><sp/>checksum<sp/>=<sp/>0xAAAA;</highlight></codeline>
<codeline lineno="3141"><highlight class="normal"></highlight></codeline>
<codeline lineno="3142"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>eeprom_size/2-1;<sp/>i++)</highlight></codeline>
<codeline lineno="3143"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>=<sp/>buf[i*2];</highlight></codeline>
<codeline lineno="3145"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>value<sp/>+=<sp/>buf[(i*2)+1]<sp/>&lt;&lt;<sp/>8;</highlight></codeline>
<codeline lineno="3146"><highlight class="normal"></highlight></codeline>
<codeline lineno="3147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>checksum<sp/>=<sp/>value^checksum;</highlight></codeline>
<codeline lineno="3148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>checksum<sp/>=<sp/>(checksum<sp/>&lt;&lt;<sp/>1)<sp/>|<sp/>(checksum<sp/>&gt;&gt;<sp/>15);</highlight></codeline>
<codeline lineno="3149"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3150"><highlight class="normal"></highlight></codeline>
<codeline lineno="3151"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom_checksum<sp/>=<sp/>buf[eeprom_size-2]<sp/>+<sp/>(buf[eeprom_size-1]<sp/>&lt;&lt;<sp/>8);</highlight></codeline>
<codeline lineno="3152"><highlight class="normal"></highlight></codeline>
<codeline lineno="3153"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom_checksum<sp/>!=<sp/>checksum)</highlight></codeline>
<codeline lineno="3154"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3155"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stderr,<sp/></highlight><highlight class="stringliteral">&quot;Checksum<sp/>Error:<sp/>%04x<sp/>%04x\n&quot;</highlight><highlight class="normal">,<sp/>checksum,<sp/>eeprom_checksum);</highlight></codeline>
<codeline lineno="3156"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,</highlight><highlight class="stringliteral">&quot;EEPROM<sp/>checksum<sp/>error&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3157"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3158"><highlight class="normal"></highlight></codeline>
<codeline lineno="3159"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" kindref="member">channel_a_type</ref><sp/><sp/><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="3160"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceac52d52869d9a67db6d6caaeaf6520ba7" kindref="member">TYPE_AM</ref>)<sp/>||<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>))</highlight></codeline>
<codeline lineno="3161"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="3163"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3164"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>)</highlight></codeline>
<codeline lineno="3165"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" kindref="member">channel_a_type</ref><sp/><sp/><sp/>=<sp/>bit2type(buf[0x00]<sp/>&amp;<sp/>0x7);</highlight></codeline>
<codeline lineno="3167"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" kindref="member">channel_a_driver</ref><sp/>=<sp/>buf[0x00]<sp/>&amp;<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="3168"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a4bf7b50ec4259aa83623bc9ed789c429" kindref="member">high_current_a</ref><sp/><sp/><sp/>=<sp/>buf[0x00]<sp/>&amp;<sp/><ref refid="ftdi_8h_1a0b41f0434b3f10219bfbfc0ae02d60a0" kindref="member">HIGH_CURRENT_DRIVE</ref>;</highlight></codeline>
<codeline lineno="3169"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a2da524307ba5904880ba6e2456adc4c1" kindref="member">channel_b_type</ref><sp/><sp/><sp/>=<sp/>buf[0x01]<sp/>&amp;<sp/>0x7;</highlight></codeline>
<codeline lineno="3170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a128def5dc4387fdcdaddaa7c9f460637" kindref="member">channel_b_driver</ref><sp/>=<sp/>buf[0x01]<sp/>&amp;<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="3171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a5016f08e6af06307abe71c15165d24ab" kindref="member">high_current_b</ref><sp/><sp/><sp/>=<sp/>buf[0x01]<sp/>&amp;<sp/><ref refid="ftdi_8h_1a0b41f0434b3f10219bfbfc0ae02d60a0" kindref="member">HIGH_CURRENT_DRIVE</ref>;</highlight></codeline>
<codeline lineno="3172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>=<sp/>buf[0x14];</highlight></codeline>
<codeline lineno="3173"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3174"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>)</highlight></codeline>
<codeline lineno="3175"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>TYPE_R<sp/>flags<sp/>D2XX,<sp/>not<sp/>VCP<sp/>as<sp/>all<sp/>others*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3177"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" kindref="member">channel_a_driver</ref><sp/>=<sp/>~buf[0x00]<sp/>&amp;<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="3178"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ad377261e985c768c2ca5731e9690efd9" kindref="member">high_current</ref><sp/><sp/><sp/><sp/><sp/>=<sp/>buf[0x00]<sp/>&amp;<sp/><ref refid="ftdi_8h_1adce93ce221bc8772e8149981be6ee5a7" kindref="member">HIGH_CURRENT_DRIVE_R</ref>;</highlight></codeline>
<codeline lineno="3179"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<sp/>(buf[0x01]&amp;0x40)<sp/>!=<sp/>0x40)</highlight></codeline>
<codeline lineno="3180"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stderr,</highlight></codeline>
<codeline lineno="3181"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;TYPE_R<sp/>EEPROM<sp/>byte[0x01]<sp/>Bit<sp/>6<sp/>unexpected<sp/>Endpoint<sp/>size.&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3182"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;<sp/>If<sp/>this<sp/>happened<sp/>with<sp/>the\n&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3183"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;<sp/>EEPROM<sp/>programmed<sp/>by<sp/>FTDI<sp/>tools,<sp/>please<sp/>report<sp/>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3184"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;to<sp/>libftdi@developer.intra2net.com\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3185"><highlight class="normal"></highlight></codeline>
<codeline lineno="3186"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>=<sp/>buf[0x16];</highlight></codeline>
<codeline lineno="3187"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>0B:<sp/>Invert<sp/>data<sp/>lines</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3188"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Works<sp/>only<sp/>on<sp/>FT232R,<sp/>not<sp/>FT245R,<sp/>but<sp/>no<sp/>way<sp/>to<sp/>distinguish</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3189"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a4876d3d01242d7c3b2961b1a42b35509" kindref="member">invert</ref><sp/>=<sp/>buf[0x0B];</highlight></codeline>
<codeline lineno="3190"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>14:<sp/>CBUS<sp/>function:<sp/>CBUS0,<sp/>CBUS1</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3191"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>15:<sp/>CBUS<sp/>function:<sp/>CBUS2,<sp/>CBUS3</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3192"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Addr<sp/>16:<sp/>CBUS<sp/>function:<sp/>CBUS5</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[0]<sp/>=<sp/>buf[0x14]<sp/>&amp;<sp/>0x0f;</highlight></codeline>
<codeline lineno="3194"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[1]<sp/>=<sp/>(buf[0x14]<sp/>&gt;&gt;<sp/>4)<sp/>&amp;<sp/>0x0f;</highlight></codeline>
<codeline lineno="3195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[2]<sp/>=<sp/>buf[0x15]<sp/>&amp;<sp/>0x0f;</highlight></codeline>
<codeline lineno="3196"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[3]<sp/>=<sp/>(buf[0x15]<sp/>&gt;&gt;<sp/>4)<sp/>&amp;<sp/>0x0f;</highlight></codeline>
<codeline lineno="3197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[4]<sp/>=<sp/>buf[0x16]<sp/>&amp;<sp/>0x0f;</highlight></codeline>
<codeline lineno="3198"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3199"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>)<sp/>||<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref>))</highlight></codeline>
<codeline lineno="3200"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" kindref="member">channel_a_driver</ref><sp/>=<sp/>buf[0x00]<sp/>&amp;<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="3202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a128def5dc4387fdcdaddaa7c9f460637" kindref="member">channel_b_driver</ref><sp/>=<sp/>buf[0x01]<sp/>&amp;<sp/><ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>;</highlight></codeline>
<codeline lineno="3203"><highlight class="normal"></highlight></codeline>
<codeline lineno="3204"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>)</highlight></codeline>
<codeline lineno="3205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" kindref="member">channel_a_type</ref><sp/><sp/><sp/>=<sp/>bit2type(buf[0x00]<sp/>&amp;<sp/>0x7);</highlight></codeline>
<codeline lineno="3207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a2da524307ba5904880ba6e2456adc4c1" kindref="member">channel_b_type</ref><sp/><sp/><sp/>=<sp/>bit2type(buf[0x01]<sp/>&amp;<sp/>0x7);</highlight></codeline>
<codeline lineno="3208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1afc46f39449462d10f9b8992523214136" kindref="member">suspend_dbus7</ref><sp/><sp/><sp/><sp/>=<sp/>buf[0x01]<sp/>&amp;<sp/><ref refid="ftdi_8h_1ada79600bc57b36a0ab93a8fbd834b8b9" kindref="member">SUSPEND_DBUS7_BIT</ref>;</highlight></codeline>
<codeline lineno="3209"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3210"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3211"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3212"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ae08edaf6d0e878a3f9e08e428ac1612d" kindref="member">channel_c_driver</ref><sp/>=<sp/>(buf[0x00]<sp/>&gt;&gt;<sp/>4)<sp/>&amp;<sp/>DRIVER_VCP;</highlight></codeline>
<codeline lineno="3213"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aea0a7b1821735930d82f24f5f0b6a006" kindref="member">channel_d_driver</ref><sp/>=<sp/>(buf[0x01]<sp/>&gt;&gt;<sp/>4)<sp/>&amp;<sp/>DRIVER_VCP;</highlight></codeline>
<codeline lineno="3214"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ac26b22453035924c2149689b07f8fae8" kindref="member">channel_a_rs485enable</ref><sp/>=<sp/>buf[0x0b]<sp/>&amp;<sp/>(<ref refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" kindref="member">CHANNEL_IS_RS485</ref><sp/>&lt;&lt;<sp/>0);</highlight></codeline>
<codeline lineno="3215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aec61d454c0f8bc1c810aa5682e9fe12a" kindref="member">channel_b_rs485enable</ref><sp/>=<sp/>buf[0x0b]<sp/>&amp;<sp/>(<ref refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" kindref="member">CHANNEL_IS_RS485</ref><sp/>&lt;&lt;<sp/>1);</highlight></codeline>
<codeline lineno="3216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a2c8f96a24402a0f8b8a4e9b34f137142" kindref="member">channel_c_rs485enable</ref><sp/>=<sp/>buf[0x0b]<sp/>&amp;<sp/>(<ref refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" kindref="member">CHANNEL_IS_RS485</ref><sp/>&lt;&lt;<sp/>2);</highlight></codeline>
<codeline lineno="3217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6b073acb642e6053c74ec2238942adb4" kindref="member">channel_d_rs485enable</ref><sp/>=<sp/>buf[0x0b]<sp/>&amp;<sp/>(<ref refid="ftdi_8h_1a8a47a8a28fecea190d427737ca1658fa" kindref="member">CHANNEL_IS_RS485</ref><sp/>&lt;&lt;<sp/>3);</highlight></codeline>
<codeline lineno="3218"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3219"><highlight class="normal"></highlight></codeline>
<codeline lineno="3220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>=<sp/>buf[0x18];</highlight></codeline>
<codeline lineno="3221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" kindref="member">group0_drive</ref><sp/><sp/><sp/>=<sp/><sp/>buf[0x0c]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>;</highlight></codeline>
<codeline lineno="3222"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" kindref="member">group0_schmitt</ref><sp/>=<sp/><sp/>buf[0x0c]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>;</highlight></codeline>
<codeline lineno="3223"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" kindref="member">group0_slew</ref><sp/><sp/><sp/><sp/>=<sp/><sp/>buf[0x0c]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>;</highlight></codeline>
<codeline lineno="3224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" kindref="member">group1_drive</ref><sp/><sp/><sp/>=<sp/>(buf[0x0c]<sp/>&gt;&gt;<sp/>4)<sp/>&amp;<sp/>0x3;</highlight></codeline>
<codeline lineno="3225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" kindref="member">group1_schmitt</ref><sp/>=<sp/>(buf[0x0c]<sp/>&gt;&gt;<sp/>4)<sp/>&amp;<sp/>IS_SCHMITT;</highlight></codeline>
<codeline lineno="3226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" kindref="member">group1_slew</ref><sp/><sp/><sp/><sp/>=<sp/>(buf[0x0c]<sp/>&gt;&gt;<sp/>4)<sp/>&amp;<sp/>SLOW_SLEW;</highlight></codeline>
<codeline lineno="3227"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a58cb0545a65f6f0bf431e186f1b44f71" kindref="member">group2_drive</ref><sp/><sp/><sp/>=<sp/><sp/>buf[0x0d]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>;</highlight></codeline>
<codeline lineno="3228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1aa6c5c7b16e649d70e358b021ad0c469e" kindref="member">group2_schmitt</ref><sp/>=<sp/><sp/>buf[0x0d]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>;</highlight></codeline>
<codeline lineno="3229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab69800fef64ca3d55449eab4322e5090" kindref="member">group2_slew</ref><sp/><sp/><sp/><sp/>=<sp/><sp/>buf[0x0d]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>;</highlight></codeline>
<codeline lineno="3230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ae5c54d334e18338296557572deee7433" kindref="member">group3_drive</ref><sp/><sp/><sp/>=<sp/>(buf[0x0d]<sp/>&gt;&gt;<sp/>4)<sp/>&amp;<sp/>DRIVE_16MA;</highlight></codeline>
<codeline lineno="3231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a7afc69623874f8b64614f2688f08033e" kindref="member">group3_schmitt</ref><sp/>=<sp/>(buf[0x0d]<sp/>&gt;&gt;<sp/>4)<sp/>&amp;<sp/>IS_SCHMITT;</highlight></codeline>
<codeline lineno="3232"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a13e5b314e0a2c1e0a67f6bb31ac07f5a" kindref="member">group3_slew</ref><sp/><sp/><sp/><sp/>=<sp/>(buf[0x0d]<sp/>&gt;&gt;<sp/>4)<sp/>&amp;<sp/>SLOW_SLEW;</highlight></codeline>
<codeline lineno="3233"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3234"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>)</highlight></codeline>
<codeline lineno="3235"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3236"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="3237"><highlight class="normal"></highlight></codeline>
<codeline lineno="3238"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" kindref="member">channel_a_type</ref><sp/><sp/><sp/>=<sp/>buf[0x00]<sp/>&amp;<sp/>0xf;</highlight></codeline>
<codeline lineno="3239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" kindref="member">channel_a_driver</ref><sp/>=<sp/>(buf[0x00]<sp/>&amp;<sp/><ref refid="ftdi_8h_1a5da3119ded0e1994a3d4fcd78da2eb6c" kindref="member">DRIVER_VCPH</ref>)?<ref refid="ftdi_8h_1a55b52774c628abfb41ea15bf537329dd" kindref="member">DRIVER_VCP</ref>:0;</highlight></codeline>
<codeline lineno="3240"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a55c072e8789a611a3842296ca1ac5171" kindref="member">clock_polarity</ref><sp/>=<sp/><sp/>buf[0x01]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1a1a6dd2fedbead82493fd1d8fbf702c91" kindref="member">FT1284_CLK_IDLE_STATE</ref>;</highlight></codeline>
<codeline lineno="3241"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a8a1f5de674bbd131e42e924ead65c617" kindref="member">data_order</ref><sp/><sp/><sp/><sp/><sp/>=<sp/><sp/>buf[0x01]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1a5b08fd32976ca0ba42f66832fdb19a8b" kindref="member">FT1284_DATA_LSB</ref>;</highlight></codeline>
<codeline lineno="3242"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a85d03dc6aa088d929eea3c7b6b7c5741" kindref="member">flow_control</ref><sp/><sp/><sp/>=<sp/><sp/>buf[0x01]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1a92220e6661b8fa1d8eac57fda958239c" kindref="member">FT1284_FLOW_CONTROL</ref>;</highlight></codeline>
<codeline lineno="3243"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1acbaa0dac427977d4f8fcd735a34bf2c3" kindref="member">powersave</ref><sp/><sp/><sp/><sp/><sp/><sp/>=<sp/><sp/>buf[0x01]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1a7fe7b5606c0cc443ec8813a562e3c6ca" kindref="member">POWER_SAVE_DISABLE_H</ref>;</highlight></codeline>
<codeline lineno="3244"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" kindref="member">group0_drive</ref><sp/><sp/><sp/>=<sp/><sp/>buf[0x0c]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>;</highlight></codeline>
<codeline lineno="3245"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" kindref="member">group0_schmitt</ref><sp/>=<sp/><sp/>buf[0x0c]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>;</highlight></codeline>
<codeline lineno="3246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" kindref="member">group0_slew</ref><sp/><sp/><sp/><sp/>=<sp/><sp/>buf[0x0c]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>;</highlight></codeline>
<codeline lineno="3247"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" kindref="member">group1_drive</ref><sp/><sp/><sp/>=<sp/><sp/>buf[0x0d]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1aef5d76022ef770568924aa28d6eb9010" kindref="member">DRIVE_16MA</ref>;</highlight></codeline>
<codeline lineno="3248"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" kindref="member">group1_schmitt</ref><sp/>=<sp/><sp/>buf[0x0d]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1ae641bb82c49f3c4853455bf16fd11e90" kindref="member">IS_SCHMITT</ref>;</highlight></codeline>
<codeline lineno="3249"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" kindref="member">group1_slew</ref><sp/><sp/><sp/><sp/>=<sp/><sp/>buf[0x0d]<sp/><sp/><sp/><sp/><sp/><sp/><sp/>&amp;<sp/><ref refid="ftdi_8h_1a0ed76622cc57f09c2e92e5888b95bcab" kindref="member">SLOW_SLEW</ref>;</highlight></codeline>
<codeline lineno="3250"><highlight class="normal"></highlight></codeline>
<codeline lineno="3251"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;<sp/>i&lt;5;<sp/>i++)</highlight></codeline>
<codeline lineno="3252"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3253"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[2*i<sp/><sp/>]<sp/>=<sp/><sp/>buf[0x18+i]<sp/>&amp;<sp/>0x0f;</highlight></codeline>
<codeline lineno="3254"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[2*i+1]<sp/>=<sp/>(buf[0x18+i]<sp/>&gt;&gt;<sp/>4)<sp/>&amp;<sp/>0x0f;</highlight></codeline>
<codeline lineno="3255"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3256"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>=<sp/>buf[0x1e];</highlight></codeline>
<codeline lineno="3257"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*FIXME:<sp/>Decipher<sp/>more<sp/>values*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3258"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3259"><highlight class="normal"></highlight></codeline>
<codeline lineno="3260"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(verbose)</highlight></codeline>
<codeline lineno="3261"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*channel_mode[]<sp/>=<sp/>{</highlight><highlight class="stringliteral">&quot;UART&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;FIFO&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;CPU&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;OPTO&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;FT1284&quot;</highlight><highlight class="normal">};</highlight></codeline>
<codeline lineno="3263"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;VID:<sp/><sp/><sp/><sp/><sp/>0x%04x\n&quot;</highlight><highlight class="normal">,eeprom-&gt;<ref refid="structftdi__eeprom_1af591e992b9bd12a484ea9d4d36e92251" kindref="member">vendor_id</ref>);</highlight></codeline>
<codeline lineno="3264"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;PID:<sp/><sp/><sp/><sp/><sp/>0x%04x\n&quot;</highlight><highlight class="normal">,eeprom-&gt;<ref refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" kindref="member">product_id</ref>);</highlight></codeline>
<codeline lineno="3265"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;Release:<sp/>0x%04x\n&quot;</highlight><highlight class="normal">,release);</highlight></codeline>
<codeline lineno="3266"><highlight class="normal"></highlight></codeline>
<codeline lineno="3267"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a055d6bef2328557e6ac4d2909e42d21b" kindref="member">self_powered</ref>)</highlight></codeline>
<codeline lineno="3268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;Self-Powered%s&quot;</highlight><highlight class="normal">,<sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a9b82f88497b432bebfa4dd92c304cb02" kindref="member">remote_wakeup</ref>)?</highlight><highlight class="stringliteral">&quot;,<sp/>USB<sp/>Remote<sp/>Wake<sp/>Up\n&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3269"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3270"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;Bus<sp/>Powered:<sp/>%3d<sp/>mA%s&quot;</highlight><highlight class="normal">,<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a8aa39af43a6ac5c05b8682d8b3904e3c" kindref="member">max_power</ref>,</highlight></codeline>
<codeline lineno="3271"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a9b82f88497b432bebfa4dd92c304cb02" kindref="member">remote_wakeup</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>USB<sp/>Remote<sp/>Wake<sp/>Up\n&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3272"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>)</highlight></codeline>
<codeline lineno="3273"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;Manufacturer:<sp/>%s\n&quot;</highlight><highlight class="normal">,eeprom-&gt;<ref refid="structftdi__eeprom_1ac4656922906039cab49d4c3c52d2916b" kindref="member">manufacturer</ref>);</highlight></codeline>
<codeline lineno="3274"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>)</highlight></codeline>
<codeline lineno="3275"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;Product:<sp/><sp/><sp/><sp/><sp/><sp/>%s\n&quot;</highlight><highlight class="normal">,eeprom-&gt;<ref refid="structftdi__eeprom_1aa24461721904d41198603dda94e0e8ec" kindref="member">product</ref>);</highlight></codeline>
<codeline lineno="3276"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>)</highlight></codeline>
<codeline lineno="3277"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;Serial:<sp/><sp/><sp/><sp/><sp/><sp/><sp/>%s\n&quot;</highlight><highlight class="normal">,eeprom-&gt;<ref refid="structftdi__eeprom_1aadcbc36d5b0569821b66dc0e0b0c61d1" kindref="member">serial</ref>);</highlight></codeline>
<codeline lineno="3278"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;Checksum<sp/><sp/><sp/><sp/><sp/><sp/>:<sp/>%04x\n&quot;</highlight><highlight class="normal">,<sp/>checksum);</highlight></codeline>
<codeline lineno="3279"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>)</highlight></codeline>
<codeline lineno="3280"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;Internal<sp/>EEPROM\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3281"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>&gt;=<sp/>0x46)</highlight></codeline>
<codeline lineno="3282"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;Attached<sp/>EEPROM:<sp/>93x%02x\n&quot;</highlight><highlight class="normal">,<sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref>);</highlight></codeline>
<codeline lineno="3283"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1afc46f39449462d10f9b8992523214136" kindref="member">suspend_dbus7</ref>)</highlight></codeline>
<codeline lineno="3284"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;Suspend<sp/>on<sp/>DBUS7\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3285"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a722a630d370318cefa94de1365f98786" kindref="member">suspend_pull_downs</ref>)</highlight></codeline>
<codeline lineno="3286"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;Pull<sp/>IO<sp/>pins<sp/>low<sp/>during<sp/>suspend\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3287"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(eeprom-&gt;<ref refid="structftdi__eeprom_1acbaa0dac427977d4f8fcd735a34bf2c3" kindref="member">powersave</ref>)</highlight></codeline>
<codeline lineno="3288"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3289"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>&gt;=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>)</highlight></codeline>
<codeline lineno="3290"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;Enter<sp/>low<sp/>power<sp/>state<sp/>on<sp/>ACBUS7\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3291"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight></codeline>
<codeline lineno="3292"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a9b82f88497b432bebfa4dd92c304cb02" kindref="member">remote_wakeup</ref>)</highlight></codeline>
<codeline lineno="3293"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;Enable<sp/>Remote<sp/>Wake<sp/>Up\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3294"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;PNP:<sp/>%d\n&quot;</highlight><highlight class="normal">,(eeprom-&gt;<ref refid="structftdi__eeprom_1a30dad8c71143befc6f947bcf04e63aa2" kindref="member">is_not_pnp</ref>)?0:1);</highlight></codeline>
<codeline lineno="3295"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>&gt;=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>)</highlight></codeline>
<codeline lineno="3296"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;Channel<sp/>A<sp/>has<sp/>Mode<sp/>%s%s%s\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3297"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>channel_mode[eeprom-&gt;<ref refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" kindref="member">channel_a_type</ref>],</highlight></codeline>
<codeline lineno="3298"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" kindref="member">channel_a_driver</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>VCP&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3299"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a4bf7b50ec4259aa83623bc9ed789c429" kindref="member">high_current_a</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>High<sp/>Current<sp/>IO&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3300"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>&gt;=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>)</highlight></codeline>
<codeline lineno="3301"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3302"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;FT1284<sp/>Mode<sp/>Clock<sp/>is<sp/>idle<sp/>%s,<sp/>%s<sp/>first,<sp/>%sFlow<sp/>Control\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3303"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a55c072e8789a611a3842296ca1ac5171" kindref="member">clock_polarity</ref>)?</highlight><highlight class="stringliteral">&quot;HIGH&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;LOW&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3304"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a8a1f5de674bbd131e42e924ead65c617" kindref="member">data_order</ref>)?</highlight><highlight class="stringliteral">&quot;LSB&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;MSB&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3305"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a85d03dc6aa088d929eea3c7b6b7c5741" kindref="member">flow_control</ref>)?</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;No<sp/>&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3306"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="3307"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>&gt;=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>)<sp/>&amp;&amp;<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>!=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>)<sp/>&amp;&amp;<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>!=<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>))</highlight></codeline>
<codeline lineno="3308"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;Channel<sp/>B<sp/>has<sp/>Mode<sp/>%s%s%s\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3309"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>channel_mode[eeprom-&gt;<ref refid="structftdi__eeprom_1a2da524307ba5904880ba6e2456adc4c1" kindref="member">channel_b_type</ref>],</highlight></codeline>
<codeline lineno="3310"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a128def5dc4387fdcdaddaa7c9f460637" kindref="member">channel_b_driver</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>VCP&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3311"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a5016f08e6af06307abe71c15165d24ab" kindref="member">high_current_b</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>High<sp/>Current<sp/>IO&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3312"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(((ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>)<sp/>||<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>))<sp/>&amp;&amp;</highlight></codeline>
<codeline lineno="3313"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>eeprom-&gt;<ref refid="structftdi__eeprom_1a54772c4686e082384adee26eeaa68005" kindref="member">use_usb_version</ref><sp/>==<sp/>USE_USB_VERSION_BIT)</highlight></codeline>
<codeline lineno="3314"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;Use<sp/>explicit<sp/>USB<sp/>Version<sp/>%04x\n&quot;</highlight><highlight class="normal">,eeprom-&gt;<ref refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" kindref="member">usb_version</ref>);</highlight></codeline>
<codeline lineno="3315"><highlight class="normal"></highlight></codeline>
<codeline lineno="3316"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>)<sp/>||<sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref>))</highlight></codeline>
<codeline lineno="3317"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3318"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;%s<sp/>has<sp/>%d<sp/>mA<sp/>drive%s%s\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3319"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>)?</highlight><highlight class="stringliteral">&quot;AL&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;A&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3320"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" kindref="member">group0_drive</ref>+1)<sp/>*4,</highlight></codeline>
<codeline lineno="3321"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" kindref="member">group0_schmitt</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>Schmitt<sp/>Input&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3322"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" kindref="member">group0_slew</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>Slow<sp/>Slew&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3323"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;%s<sp/>has<sp/>%d<sp/>mA<sp/>drive%s%s\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3324"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>)?</highlight><highlight class="stringliteral">&quot;AH&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;B&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3325"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" kindref="member">group1_drive</ref>+1)<sp/>*4,</highlight></codeline>
<codeline lineno="3326"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" kindref="member">group1_schmitt</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>Schmitt<sp/>Input&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3327"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" kindref="member">group1_slew</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>Slow<sp/>Slew&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3328"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;%s<sp/>has<sp/>%d<sp/>mA<sp/>drive%s%s\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3329"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>)?</highlight><highlight class="stringliteral">&quot;BL&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;C&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3330"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a58cb0545a65f6f0bf431e186f1b44f71" kindref="member">group2_drive</ref>+1)<sp/>*4,</highlight></codeline>
<codeline lineno="3331"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1aa6c5c7b16e649d70e358b021ad0c469e" kindref="member">group2_schmitt</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>Schmitt<sp/>Input&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3332"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab69800fef64ca3d55449eab4322e5090" kindref="member">group2_slew</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>Slow<sp/>Slew&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3333"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;%s<sp/>has<sp/>%d<sp/>mA<sp/>drive%s%s\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3334"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>)?</highlight><highlight class="stringliteral">&quot;BH&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;D&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3335"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ae5c54d334e18338296557572deee7433" kindref="member">group3_drive</ref>+1)<sp/>*4,</highlight></codeline>
<codeline lineno="3336"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a7afc69623874f8b64614f2688f08033e" kindref="member">group3_schmitt</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>Schmitt<sp/>Input&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3337"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a13e5b314e0a2c1e0a67f6bb31ac07f5a" kindref="member">group3_slew</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>Slow<sp/>Slew&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3338"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3339"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>)</highlight></codeline>
<codeline lineno="3340"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3341"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="3342"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*cbush_mux[]<sp/>=<sp/>{</highlight><highlight class="stringliteral">&quot;TRISTATE&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;RXLED&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;TXLED&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;TXRXLED&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;PWREN&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3343"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;SLEEP&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;DRIVE_0&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;DRIVE_1&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;IOMODE&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;TXDEN&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3344"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;CLK30&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;CLK15&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;CLK7_5&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3345"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
<codeline lineno="3346"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;ACBUS<sp/>has<sp/>%d<sp/>mA<sp/>drive%s%s\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3347"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" kindref="member">group0_drive</ref>+1)<sp/>*4,</highlight></codeline>
<codeline lineno="3348"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" kindref="member">group0_schmitt</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>Schmitt<sp/>Input&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3349"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" kindref="member">group0_slew</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>Slow<sp/>Slew&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3350"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;ADBUS<sp/>has<sp/>%d<sp/>mA<sp/>drive%s%s\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3351"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" kindref="member">group1_drive</ref>+1)<sp/>*4,</highlight></codeline>
<codeline lineno="3352"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" kindref="member">group1_schmitt</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>Schmitt<sp/>Input&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3353"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" kindref="member">group1_slew</ref>)?</highlight><highlight class="stringliteral">&quot;<sp/>Slow<sp/>Slew&quot;</highlight><highlight class="normal">:</highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3354"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;10;<sp/>i++)</highlight></codeline>
<codeline lineno="3355"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3356"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[i]&lt;=<sp/><ref refid="ftdi_8h_1a5b83df6ac73aeb8f0126ebe2efcebfc2a2d2d141e7e78469b4aff505263231a87" kindref="member">CBUSH_CLK7_5</ref><sp/>)</highlight></codeline>
<codeline lineno="3357"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;C%d<sp/>Function:<sp/>%s\n&quot;</highlight><highlight class="normal">,<sp/>i,</highlight></codeline>
<codeline lineno="3358"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cbush_mux[eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[i]]);</highlight></codeline>
<codeline lineno="3359"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3360"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3361"><highlight class="normal"></highlight></codeline>
<codeline lineno="3362"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>)</highlight></codeline>
<codeline lineno="3363"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3364"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*cbus_mux[]<sp/>=<sp/>{</highlight><highlight class="stringliteral">&quot;TXDEN&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;PWREN&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;RXLED&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;TXLED&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;TX+RXLED&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3365"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;SLEEP&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;CLK48&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;CLK24&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;CLK12&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;CLK6&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="3366"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="stringliteral">&quot;IOMODE&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;BB_WR&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;BB_RD&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3367"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>};</highlight></codeline>
<codeline lineno="3368"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*cbus_BB[]<sp/>=<sp/>{</highlight><highlight class="stringliteral">&quot;RXF&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;TXE&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;RD&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;WR&quot;</highlight><highlight class="normal">};</highlight></codeline>
<codeline lineno="3369"><highlight class="normal"></highlight></codeline>
<codeline lineno="3370"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1a4876d3d01242d7c3b2961b1a42b35509" kindref="member">invert</ref>)</highlight></codeline>
<codeline lineno="3371"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3372"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*r_bits[]<sp/>=<sp/>{</highlight><highlight class="stringliteral">&quot;TXD&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;RXD&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;RTS&quot;</highlight><highlight class="normal">,<sp/></highlight><highlight class="stringliteral">&quot;CTS&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;DTR&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;DSR&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;DCD&quot;</highlight><highlight class="normal">,</highlight><highlight class="stringliteral">&quot;RI&quot;</highlight><highlight class="normal">};</highlight></codeline>
<codeline lineno="3373"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;Inverted<sp/>bits:&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3374"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;8;<sp/>i++)</highlight></codeline>
<codeline lineno="3375"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((eeprom-&gt;<ref refid="structftdi__eeprom_1a4876d3d01242d7c3b2961b1a42b35509" kindref="member">invert</ref><sp/>&amp;<sp/>(1&lt;&lt;i))<sp/>==<sp/>(1&lt;&lt;i))</highlight></codeline>
<codeline lineno="3376"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;<sp/>%s&quot;</highlight><highlight class="normal">,r_bits[i]);</highlight></codeline>
<codeline lineno="3377"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3378"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3379"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i=0;<sp/>i&lt;5;<sp/>i++)</highlight></codeline>
<codeline lineno="3380"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3381"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[i]&lt;<ref refid="ftdi_8h_1acc98362b5a36608559eb3c764164f7b2a192d6684008401d4be18a17cab683741" kindref="member">CBUS_BB</ref>)</highlight></codeline>
<codeline lineno="3382"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;C%d<sp/>Function:<sp/>%s\n&quot;</highlight><highlight class="normal">,<sp/>i,</highlight></codeline>
<codeline lineno="3383"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cbus_mux[eeprom-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[i]]);</highlight></codeline>
<codeline lineno="3384"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3385"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3386"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(i<sp/>&lt;<sp/>4)</highlight></codeline>
<codeline lineno="3387"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Running<sp/>MPROG<sp/>show<sp/>that<sp/>C0..3<sp/>have<sp/>fixed<sp/>function<sp/>Synchronous</highlight></codeline>
<codeline lineno="3388"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Bit<sp/>Bang<sp/>mode<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3389"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,</highlight><highlight class="stringliteral">&quot;C%d<sp/>BB<sp/>Function:<sp/>%s\n&quot;</highlight><highlight class="normal">,<sp/>i,</highlight></codeline>
<codeline lineno="3390"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>cbus_BB[i]);</highlight></codeline>
<codeline lineno="3391"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3392"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fprintf(stdout,<sp/></highlight><highlight class="stringliteral">&quot;Unknown<sp/>CBUS<sp/>mode.<sp/>Might<sp/>be<sp/>special<sp/>mode?\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3393"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3394"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3395"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3396"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3397"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="3398"><highlight class="normal">}</highlight></codeline>
<codeline lineno="3399"><highlight class="normal"></highlight></codeline>
<codeline lineno="3410" refid="group__libftdi_1ga6213209895e40153d103a72654d53b81" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga6213209895e40153d103a72654d53b81" kindref="member">ftdi_get_eeprom_value</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cd" kindref="member">ftdi_eeprom_value</ref><sp/>value_name,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal">*<sp/>value)</highlight></codeline>
<codeline lineno="3411"><highlight class="normal">{</highlight></codeline>
<codeline lineno="3412"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(value_name)</highlight></codeline>
<codeline lineno="3413"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3414"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda9fe07086ac9a218e8214ba9e7a5f7933" kindref="member">VENDOR_ID</ref>:</highlight></codeline>
<codeline lineno="3415"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1af591e992b9bd12a484ea9d4d36e92251" kindref="member">vendor_id</ref>;</highlight></codeline>
<codeline lineno="3416"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3417"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda6c2d445571c53a6ffaa9ad9e84258e6b" kindref="member">PRODUCT_ID</ref>:</highlight></codeline>
<codeline lineno="3418"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" kindref="member">product_id</ref>;</highlight></codeline>
<codeline lineno="3419"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3420"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda8921cc2e575c669f3b6116ec6c2946a4" kindref="member">SELF_POWERED</ref>:</highlight></codeline>
<codeline lineno="3421"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a055d6bef2328557e6ac4d2909e42d21b" kindref="member">self_powered</ref>;</highlight></codeline>
<codeline lineno="3422"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3423"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda65603b0b33ba5a1cf2fc9abbabf731eb" kindref="member">REMOTE_WAKEUP</ref>:</highlight></codeline>
<codeline lineno="3424"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a9b82f88497b432bebfa4dd92c304cb02" kindref="member">remote_wakeup</ref>;</highlight></codeline>
<codeline lineno="3425"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3426"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda80005060e30959d4d90449f343a0b777" kindref="member">IS_NOT_PNP</ref>:</highlight></codeline>
<codeline lineno="3427"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a30dad8c71143befc6f947bcf04e63aa2" kindref="member">is_not_pnp</ref>;</highlight></codeline>
<codeline lineno="3428"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3429"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda17887eedccc85d83d1ce847be1e433ed" kindref="member">SUSPEND_DBUS7</ref>:</highlight></codeline>
<codeline lineno="3430"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1afc46f39449462d10f9b8992523214136" kindref="member">suspend_dbus7</ref>;</highlight></codeline>
<codeline lineno="3431"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3432"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda14520ed9a009b332096746b8b014ba84" kindref="member">IN_IS_ISOCHRONOUS</ref>:</highlight></codeline>
<codeline lineno="3433"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a5117b50c00668aff73b5df385b0fc5f8" kindref="member">in_is_isochronous</ref>;</highlight></codeline>
<codeline lineno="3434"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3435"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdac3d4167972b6222c4035a259fca7126d" kindref="member">OUT_IS_ISOCHRONOUS</ref>:</highlight></codeline>
<codeline lineno="3436"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab9885ee665c318a8d19c28a9c75b999a" kindref="member">out_is_isochronous</ref>;</highlight></codeline>
<codeline lineno="3437"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3438"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda68d4ae93864ec70b19d9cf511d8f05ec" kindref="member">SUSPEND_PULL_DOWNS</ref>:</highlight></codeline>
<codeline lineno="3439"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a722a630d370318cefa94de1365f98786" kindref="member">suspend_pull_downs</ref>;</highlight></codeline>
<codeline lineno="3440"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3441"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda766bf8fb28072e760bd2dfdcbb2cc102" kindref="member">USE_SERIAL</ref>:</highlight></codeline>
<codeline lineno="3442"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1abe250275595d020fd8de3aa61d093d38" kindref="member">use_serial</ref>;</highlight></codeline>
<codeline lineno="3443"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3444"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda54e6e162c0578b9576d31c069d43f3da" kindref="member">USB_VERSION</ref>:</highlight></codeline>
<codeline lineno="3445"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" kindref="member">usb_version</ref>;</highlight></codeline>
<codeline lineno="3446"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3447"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda2a153af6487afaffc04f13785c99ba66" kindref="member">USE_USB_VERSION</ref>:</highlight></codeline>
<codeline lineno="3448"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a54772c4686e082384adee26eeaa68005" kindref="member">use_usb_version</ref>;</highlight></codeline>
<codeline lineno="3449"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3450"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda83623d0e379659fb8113d8c5f6394706" kindref="member">MAX_POWER</ref>:</highlight></codeline>
<codeline lineno="3451"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a8aa39af43a6ac5c05b8682d8b3904e3c" kindref="member">max_power</ref>;</highlight></codeline>
<codeline lineno="3452"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3453"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda86c1629835d45789c2bf3a7ee2fa7164" kindref="member">CHANNEL_A_TYPE</ref>:</highlight></codeline>
<codeline lineno="3454"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" kindref="member">channel_a_type</ref>;</highlight></codeline>
<codeline lineno="3455"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3456"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda7ca539644f82b44fc59004dec38d3f43" kindref="member">CHANNEL_B_TYPE</ref>:</highlight></codeline>
<codeline lineno="3457"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a2da524307ba5904880ba6e2456adc4c1" kindref="member">channel_b_type</ref>;</highlight></codeline>
<codeline lineno="3458"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3459"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda9764d3fb2ce5d3eff6f743dd8cfe1395" kindref="member">CHANNEL_A_DRIVER</ref>:</highlight></codeline>
<codeline lineno="3460"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" kindref="member">channel_a_driver</ref>;</highlight></codeline>
<codeline lineno="3461"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3462"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda277bd50fdc3904c70fb6851850469f21" kindref="member">CHANNEL_B_DRIVER</ref>:</highlight></codeline>
<codeline lineno="3463"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a128def5dc4387fdcdaddaa7c9f460637" kindref="member">channel_b_driver</ref>;</highlight></codeline>
<codeline lineno="3464"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3465"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda433b65c4524f72ee39083345b0f15a93" kindref="member">CHANNEL_C_DRIVER</ref>:</highlight></codeline>
<codeline lineno="3466"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ae08edaf6d0e878a3f9e08e428ac1612d" kindref="member">channel_c_driver</ref>;</highlight></codeline>
<codeline lineno="3467"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3468"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1f94c84fbd97ca5aceceff5303914219" kindref="member">CHANNEL_D_DRIVER</ref>:</highlight></codeline>
<codeline lineno="3469"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1aea0a7b1821735930d82f24f5f0b6a006" kindref="member">channel_d_driver</ref>;</highlight></codeline>
<codeline lineno="3470"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3471"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaee98eeb2d224f9b2c7dffc9951766ddf" kindref="member">CHANNEL_A_RS485</ref>:</highlight></codeline>
<codeline lineno="3472"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ac26b22453035924c2149689b07f8fae8" kindref="member">channel_a_rs485enable</ref>;</highlight></codeline>
<codeline lineno="3473"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3474"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda0193b368cbac2a9e7212d036532970f8" kindref="member">CHANNEL_B_RS485</ref>:</highlight></codeline>
<codeline lineno="3475"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1aec61d454c0f8bc1c810aa5682e9fe12a" kindref="member">channel_b_rs485enable</ref>;</highlight></codeline>
<codeline lineno="3476"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3477"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda2c2c59d298e324f9134e0e0aa7a2b6d2" kindref="member">CHANNEL_C_RS485</ref>:</highlight></codeline>
<codeline lineno="3478"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a2c8f96a24402a0f8b8a4e9b34f137142" kindref="member">channel_c_rs485enable</ref>;</highlight></codeline>
<codeline lineno="3479"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3480"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda7c62d86e2e2dbb3cb0d05ac67eed71e0" kindref="member">CHANNEL_D_RS485</ref>:</highlight></codeline>
<codeline lineno="3481"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6b073acb642e6053c74ec2238942adb4" kindref="member">channel_d_rs485enable</ref>;</highlight></codeline>
<codeline lineno="3482"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3483"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdadec48df2aacb6daa4523f4fc6e09032b" kindref="member">CBUS_FUNCTION_0</ref>:</highlight></codeline>
<codeline lineno="3484"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[0];</highlight></codeline>
<codeline lineno="3485"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3486"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda7dd4d452169ab40e99c849f1b4ed4110" kindref="member">CBUS_FUNCTION_1</ref>:</highlight></codeline>
<codeline lineno="3487"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[1];</highlight></codeline>
<codeline lineno="3488"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3489"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda307435ed7db2708581a0e86eb180200c" kindref="member">CBUS_FUNCTION_2</ref>:</highlight></codeline>
<codeline lineno="3490"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[2];</highlight></codeline>
<codeline lineno="3491"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3492"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdabe2751f6a199a5686b80da1eda17d871" kindref="member">CBUS_FUNCTION_3</ref>:</highlight></codeline>
<codeline lineno="3493"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[3];</highlight></codeline>
<codeline lineno="3494"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3495"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda5e97bbd3da3aa1aa171bf33a7a9307d1" kindref="member">CBUS_FUNCTION_4</ref>:</highlight></codeline>
<codeline lineno="3496"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[4];</highlight></codeline>
<codeline lineno="3497"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3498"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdad39c5f41d1d70a9296ae14b3e8681c53" kindref="member">CBUS_FUNCTION_5</ref>:</highlight></codeline>
<codeline lineno="3499"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[5];</highlight></codeline>
<codeline lineno="3500"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3501"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda0785c792f5ea33548404dfc19e39176b" kindref="member">CBUS_FUNCTION_6</ref>:</highlight></codeline>
<codeline lineno="3502"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[6];</highlight></codeline>
<codeline lineno="3503"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3504"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdac4b158896f5efa2e5f1afef2532f2adf" kindref="member">CBUS_FUNCTION_7</ref>:</highlight></codeline>
<codeline lineno="3505"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[7];</highlight></codeline>
<codeline lineno="3506"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3507"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1d27121cb964655a42a066a188c690d2" kindref="member">CBUS_FUNCTION_8</ref>:</highlight></codeline>
<codeline lineno="3508"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[8];</highlight></codeline>
<codeline lineno="3509"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3510"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda0848e6d92df2404a9c1c9010ebba972d" kindref="member">CBUS_FUNCTION_9</ref>:</highlight></codeline>
<codeline lineno="3511"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[8];</highlight></codeline>
<codeline lineno="3512"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3513"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda70b51ab39f14a27a35a89e07bd6807aa" kindref="member">HIGH_CURRENT</ref>:</highlight></codeline>
<codeline lineno="3514"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ad377261e985c768c2ca5731e9690efd9" kindref="member">high_current</ref>;</highlight></codeline>
<codeline lineno="3515"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3516"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda8ec56c968baf80eae5239dba2616868f" kindref="member">HIGH_CURRENT_A</ref>:</highlight></codeline>
<codeline lineno="3517"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a4bf7b50ec4259aa83623bc9ed789c429" kindref="member">high_current_a</ref>;</highlight></codeline>
<codeline lineno="3518"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3519"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda99f59a21df7285884ce88738d1e97187" kindref="member">HIGH_CURRENT_B</ref>:</highlight></codeline>
<codeline lineno="3520"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a5016f08e6af06307abe71c15165d24ab" kindref="member">high_current_b</ref>;</highlight></codeline>
<codeline lineno="3521"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3522"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdab5f95af56a0f14f0032750594b523c95" kindref="member">INVERT</ref>:</highlight></codeline>
<codeline lineno="3523"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a4876d3d01242d7c3b2961b1a42b35509" kindref="member">invert</ref>;</highlight></codeline>
<codeline lineno="3524"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3525"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdae603ca8f2ed0811de45a9822fe10e405" kindref="member">GROUP0_DRIVE</ref>:</highlight></codeline>
<codeline lineno="3526"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" kindref="member">group0_drive</ref>;</highlight></codeline>
<codeline lineno="3527"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3528"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaaabac9a535a103060a0b2a972985b2ec" kindref="member">GROUP0_SCHMITT</ref>:</highlight></codeline>
<codeline lineno="3529"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" kindref="member">group0_schmitt</ref>;</highlight></codeline>
<codeline lineno="3530"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3531"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda5e99a23ccf517c4846f1ccbf99539009" kindref="member">GROUP0_SLEW</ref>:</highlight></codeline>
<codeline lineno="3532"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" kindref="member">group0_slew</ref>;</highlight></codeline>
<codeline lineno="3533"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3534"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaf4659c175213672ec8390fef0e846822" kindref="member">GROUP1_DRIVE</ref>:</highlight></codeline>
<codeline lineno="3535"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" kindref="member">group1_drive</ref>;</highlight></codeline>
<codeline lineno="3536"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3537"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda01c1da99b72ec3e60ac6800f5baaf469" kindref="member">GROUP1_SCHMITT</ref>:</highlight></codeline>
<codeline lineno="3538"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" kindref="member">group1_schmitt</ref>;</highlight></codeline>
<codeline lineno="3539"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3540"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda8ceab8fc99a4e1ff94c31cf6c8f88028" kindref="member">GROUP1_SLEW</ref>:</highlight></codeline>
<codeline lineno="3541"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" kindref="member">group1_slew</ref>;</highlight></codeline>
<codeline lineno="3542"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3543"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda02006a9fb9f6b3272e60382266f27e6f" kindref="member">GROUP2_DRIVE</ref>:</highlight></codeline>
<codeline lineno="3544"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a58cb0545a65f6f0bf431e186f1b44f71" kindref="member">group2_drive</ref>;</highlight></codeline>
<codeline lineno="3545"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3546"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda18987baccc2899292d93b35d953905f1" kindref="member">GROUP2_SCHMITT</ref>:</highlight></codeline>
<codeline lineno="3547"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1aa6c5c7b16e649d70e358b021ad0c469e" kindref="member">group2_schmitt</ref>;</highlight></codeline>
<codeline lineno="3548"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3549"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdabbb8cd7178ae1d655a205c8197f5bbdd" kindref="member">GROUP2_SLEW</ref>:</highlight></codeline>
<codeline lineno="3550"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab69800fef64ca3d55449eab4322e5090" kindref="member">group2_slew</ref>;</highlight></codeline>
<codeline lineno="3551"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3552"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda954be78df39d339bc94729789f81a03e" kindref="member">GROUP3_DRIVE</ref>:</highlight></codeline>
<codeline lineno="3553"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ae5c54d334e18338296557572deee7433" kindref="member">group3_drive</ref>;</highlight></codeline>
<codeline lineno="3554"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3555"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaff4e78fe8f024261c763dc3e3dccc717" kindref="member">GROUP3_SCHMITT</ref>:</highlight></codeline>
<codeline lineno="3556"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a7afc69623874f8b64614f2688f08033e" kindref="member">group3_schmitt</ref>;</highlight></codeline>
<codeline lineno="3557"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3558"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdae7befb90d908e4035c69dfe8e783e29a" kindref="member">GROUP3_SLEW</ref>:</highlight></codeline>
<codeline lineno="3559"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a13e5b314e0a2c1e0a67f6bb31ac07f5a" kindref="member">group3_slew</ref>;</highlight></codeline>
<codeline lineno="3560"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3561"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda412ffca781db3a099f287df487667d19" kindref="member">POWER_SAVE</ref>:</highlight></codeline>
<codeline lineno="3562"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1acbaa0dac427977d4f8fcd735a34bf2c3" kindref="member">powersave</ref>;</highlight></codeline>
<codeline lineno="3563"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3564"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda54b3c39afc0140c234654d1738f0f18c" kindref="member">CLOCK_POLARITY</ref>:</highlight></codeline>
<codeline lineno="3565"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a55c072e8789a611a3842296ca1ac5171" kindref="member">clock_polarity</ref>;</highlight></codeline>
<codeline lineno="3566"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3567"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1ecdc817b75811273206a5dededf4ddb" kindref="member">DATA_ORDER</ref>:</highlight></codeline>
<codeline lineno="3568"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a8a1f5de674bbd131e42e924ead65c617" kindref="member">data_order</ref>;</highlight></codeline>
<codeline lineno="3569"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3570"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1bc9ce65b7a27fdf832b69aef487b6b1" kindref="member">FLOW_CONTROL</ref>:</highlight></codeline>
<codeline lineno="3571"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a85d03dc6aa088d929eea3c7b6b7c5741" kindref="member">flow_control</ref>;</highlight></codeline>
<codeline lineno="3572"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3573"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdab3160717262b754c6d4895cd9a3daf2e" kindref="member">CHIP_TYPE</ref>:</highlight></codeline>
<codeline lineno="3574"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref>;</highlight></codeline>
<codeline lineno="3575"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3576"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda381285b7c4454a1f04d43887b55a76b9" kindref="member">CHIP_SIZE</ref>:</highlight></codeline>
<codeline lineno="3577"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*value<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref>;</highlight></codeline>
<codeline lineno="3578"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3579"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="3580"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;Request<sp/>for<sp/>unknown<sp/>EEPROM<sp/>value&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3581"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3582"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="3583"><highlight class="normal">}</highlight></codeline>
<codeline lineno="3584"><highlight class="normal"></highlight></codeline>
<codeline lineno="3597" refid="group__libftdi_1ga8e120f60f65859c1976c2dba99e9d002" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga8e120f60f65859c1976c2dba99e9d002" kindref="member">ftdi_set_eeprom_value</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keyword">enum</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cd" kindref="member">ftdi_eeprom_value</ref><sp/>value_name,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>value)</highlight></codeline>
<codeline lineno="3598"><highlight class="normal">{</highlight></codeline>
<codeline lineno="3599"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(value_name)</highlight></codeline>
<codeline lineno="3600"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3601"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda9fe07086ac9a218e8214ba9e7a5f7933" kindref="member">VENDOR_ID</ref>:</highlight></codeline>
<codeline lineno="3602"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1af591e992b9bd12a484ea9d4d36e92251" kindref="member">vendor_id</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3603"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3604"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda6c2d445571c53a6ffaa9ad9e84258e6b" kindref="member">PRODUCT_ID</ref>:</highlight></codeline>
<codeline lineno="3605"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab273d6fe056b3871824486ad0bfa3a90" kindref="member">product_id</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3606"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3607"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda8921cc2e575c669f3b6116ec6c2946a4" kindref="member">SELF_POWERED</ref>:</highlight></codeline>
<codeline lineno="3608"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a055d6bef2328557e6ac4d2909e42d21b" kindref="member">self_powered</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3609"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3610"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda65603b0b33ba5a1cf2fc9abbabf731eb" kindref="member">REMOTE_WAKEUP</ref>:</highlight></codeline>
<codeline lineno="3611"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a9b82f88497b432bebfa4dd92c304cb02" kindref="member">remote_wakeup</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3612"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3613"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda80005060e30959d4d90449f343a0b777" kindref="member">IS_NOT_PNP</ref>:</highlight></codeline>
<codeline lineno="3614"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a30dad8c71143befc6f947bcf04e63aa2" kindref="member">is_not_pnp</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3615"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3616"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda17887eedccc85d83d1ce847be1e433ed" kindref="member">SUSPEND_DBUS7</ref>:</highlight></codeline>
<codeline lineno="3617"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1afc46f39449462d10f9b8992523214136" kindref="member">suspend_dbus7</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3618"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3619"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda14520ed9a009b332096746b8b014ba84" kindref="member">IN_IS_ISOCHRONOUS</ref>:</highlight></codeline>
<codeline lineno="3620"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a5117b50c00668aff73b5df385b0fc5f8" kindref="member">in_is_isochronous</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3621"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3622"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdac3d4167972b6222c4035a259fca7126d" kindref="member">OUT_IS_ISOCHRONOUS</ref>:</highlight></codeline>
<codeline lineno="3623"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab9885ee665c318a8d19c28a9c75b999a" kindref="member">out_is_isochronous</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3624"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3625"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda68d4ae93864ec70b19d9cf511d8f05ec" kindref="member">SUSPEND_PULL_DOWNS</ref>:</highlight></codeline>
<codeline lineno="3626"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a722a630d370318cefa94de1365f98786" kindref="member">suspend_pull_downs</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3627"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3628"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda766bf8fb28072e760bd2dfdcbb2cc102" kindref="member">USE_SERIAL</ref>:</highlight></codeline>
<codeline lineno="3629"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1abe250275595d020fd8de3aa61d093d38" kindref="member">use_serial</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3630"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3631"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda54e6e162c0578b9576d31c069d43f3da" kindref="member">USB_VERSION</ref>:</highlight></codeline>
<codeline lineno="3632"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a7c0093a9bfbdf7a3c89e18228fcaba84" kindref="member">usb_version</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3633"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3634"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda2a153af6487afaffc04f13785c99ba66" kindref="member">USE_USB_VERSION</ref>:</highlight></codeline>
<codeline lineno="3635"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a54772c4686e082384adee26eeaa68005" kindref="member">use_usb_version</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3636"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3637"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda83623d0e379659fb8113d8c5f6394706" kindref="member">MAX_POWER</ref>:</highlight></codeline>
<codeline lineno="3638"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a8aa39af43a6ac5c05b8682d8b3904e3c" kindref="member">max_power</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3639"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3640"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda86c1629835d45789c2bf3a7ee2fa7164" kindref="member">CHANNEL_A_TYPE</ref>:</highlight></codeline>
<codeline lineno="3641"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ae29685074e87375b8d78580f28a06b5e" kindref="member">channel_a_type</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3642"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3643"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda7ca539644f82b44fc59004dec38d3f43" kindref="member">CHANNEL_B_TYPE</ref>:</highlight></codeline>
<codeline lineno="3644"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a2da524307ba5904880ba6e2456adc4c1" kindref="member">channel_b_type</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3645"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3646"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda9764d3fb2ce5d3eff6f743dd8cfe1395" kindref="member">CHANNEL_A_DRIVER</ref>:</highlight></codeline>
<codeline lineno="3647"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a67da21be4bf17ee3e0b12a92c3587bb0" kindref="member">channel_a_driver</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3648"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3649"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda277bd50fdc3904c70fb6851850469f21" kindref="member">CHANNEL_B_DRIVER</ref>:</highlight></codeline>
<codeline lineno="3650"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a128def5dc4387fdcdaddaa7c9f460637" kindref="member">channel_b_driver</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3651"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3652"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda433b65c4524f72ee39083345b0f15a93" kindref="member">CHANNEL_C_DRIVER</ref>:</highlight></codeline>
<codeline lineno="3653"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ae08edaf6d0e878a3f9e08e428ac1612d" kindref="member">channel_c_driver</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3654"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3655"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1f94c84fbd97ca5aceceff5303914219" kindref="member">CHANNEL_D_DRIVER</ref>:</highlight></codeline>
<codeline lineno="3656"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1aea0a7b1821735930d82f24f5f0b6a006" kindref="member">channel_d_driver</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3657"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3658"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaee98eeb2d224f9b2c7dffc9951766ddf" kindref="member">CHANNEL_A_RS485</ref>:</highlight></codeline>
<codeline lineno="3659"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ac26b22453035924c2149689b07f8fae8" kindref="member">channel_a_rs485enable</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3660"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3661"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda0193b368cbac2a9e7212d036532970f8" kindref="member">CHANNEL_B_RS485</ref>:</highlight></codeline>
<codeline lineno="3662"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1aec61d454c0f8bc1c810aa5682e9fe12a" kindref="member">channel_b_rs485enable</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3663"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3664"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda2c2c59d298e324f9134e0e0aa7a2b6d2" kindref="member">CHANNEL_C_RS485</ref>:</highlight></codeline>
<codeline lineno="3665"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a2c8f96a24402a0f8b8a4e9b34f137142" kindref="member">channel_c_rs485enable</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3666"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3667"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda7c62d86e2e2dbb3cb0d05ac67eed71e0" kindref="member">CHANNEL_D_RS485</ref>:</highlight></codeline>
<codeline lineno="3668"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6b073acb642e6053c74ec2238942adb4" kindref="member">channel_d_rs485enable</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3669"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3670"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdadec48df2aacb6daa4523f4fc6e09032b" kindref="member">CBUS_FUNCTION_0</ref>:</highlight></codeline>
<codeline lineno="3671"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[0]<sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3672"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3673"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda7dd4d452169ab40e99c849f1b4ed4110" kindref="member">CBUS_FUNCTION_1</ref>:</highlight></codeline>
<codeline lineno="3674"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[1]<sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3675"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3676"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda307435ed7db2708581a0e86eb180200c" kindref="member">CBUS_FUNCTION_2</ref>:</highlight></codeline>
<codeline lineno="3677"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[2]<sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3678"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3679"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdabe2751f6a199a5686b80da1eda17d871" kindref="member">CBUS_FUNCTION_3</ref>:</highlight></codeline>
<codeline lineno="3680"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[3]<sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3681"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3682"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda5e97bbd3da3aa1aa171bf33a7a9307d1" kindref="member">CBUS_FUNCTION_4</ref>:</highlight></codeline>
<codeline lineno="3683"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[4]<sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3684"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3685"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdad39c5f41d1d70a9296ae14b3e8681c53" kindref="member">CBUS_FUNCTION_5</ref>:</highlight></codeline>
<codeline lineno="3686"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[5]<sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3687"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3688"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda0785c792f5ea33548404dfc19e39176b" kindref="member">CBUS_FUNCTION_6</ref>:</highlight></codeline>
<codeline lineno="3689"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[6]<sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3690"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3691"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdac4b158896f5efa2e5f1afef2532f2adf" kindref="member">CBUS_FUNCTION_7</ref>:</highlight></codeline>
<codeline lineno="3692"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[7]<sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3693"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3694"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1d27121cb964655a42a066a188c690d2" kindref="member">CBUS_FUNCTION_8</ref>:</highlight></codeline>
<codeline lineno="3695"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[8]<sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3696"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3697"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda0848e6d92df2404a9c1c9010ebba972d" kindref="member">CBUS_FUNCTION_9</ref>:</highlight></codeline>
<codeline lineno="3698"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab32eecde1bd636a290c7f03eb4489b4d" kindref="member">cbus_function</ref>[9]<sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3699"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3700"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda70b51ab39f14a27a35a89e07bd6807aa" kindref="member">HIGH_CURRENT</ref>:</highlight></codeline>
<codeline lineno="3701"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ad377261e985c768c2ca5731e9690efd9" kindref="member">high_current</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3702"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3703"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda8ec56c968baf80eae5239dba2616868f" kindref="member">HIGH_CURRENT_A</ref>:</highlight></codeline>
<codeline lineno="3704"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a4bf7b50ec4259aa83623bc9ed789c429" kindref="member">high_current_a</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3705"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3706"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda99f59a21df7285884ce88738d1e97187" kindref="member">HIGH_CURRENT_B</ref>:</highlight></codeline>
<codeline lineno="3707"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a5016f08e6af06307abe71c15165d24ab" kindref="member">high_current_b</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3708"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3709"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdab5f95af56a0f14f0032750594b523c95" kindref="member">INVERT</ref>:</highlight></codeline>
<codeline lineno="3710"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a4876d3d01242d7c3b2961b1a42b35509" kindref="member">invert</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3711"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3712"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdae603ca8f2ed0811de45a9822fe10e405" kindref="member">GROUP0_DRIVE</ref>:</highlight></codeline>
<codeline lineno="3713"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1abb17ef38c4e3b37b404ab2d165c47571" kindref="member">group0_drive</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3714"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3715"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaaabac9a535a103060a0b2a972985b2ec" kindref="member">GROUP0_SCHMITT</ref>:</highlight></codeline>
<codeline lineno="3716"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a385c1dc1b3d4a0ca20009a6d86c4ee3f" kindref="member">group0_schmitt</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3717"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3718"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda5e99a23ccf517c4846f1ccbf99539009" kindref="member">GROUP0_SLEW</ref>:</highlight></codeline>
<codeline lineno="3719"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab796b679fceb9add14021713b0b7b331" kindref="member">group0_slew</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3720"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3721"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaf4659c175213672ec8390fef0e846822" kindref="member">GROUP1_DRIVE</ref>:</highlight></codeline>
<codeline lineno="3722"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a638460da4cad2d7ad472a623e47c53b8" kindref="member">group1_drive</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3723"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3724"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda01c1da99b72ec3e60ac6800f5baaf469" kindref="member">GROUP1_SCHMITT</ref>:</highlight></codeline>
<codeline lineno="3725"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ac1b64d7825d1072468beb430129423ca" kindref="member">group1_schmitt</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3726"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3727"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda8ceab8fc99a4e1ff94c31cf6c8f88028" kindref="member">GROUP1_SLEW</ref>:</highlight></codeline>
<codeline lineno="3728"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a8f219130bd0ee17c79a8d1ecadae2079" kindref="member">group1_slew</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3729"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3730"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda02006a9fb9f6b3272e60382266f27e6f" kindref="member">GROUP2_DRIVE</ref>:</highlight></codeline>
<codeline lineno="3731"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a58cb0545a65f6f0bf431e186f1b44f71" kindref="member">group2_drive</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3732"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3733"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda18987baccc2899292d93b35d953905f1" kindref="member">GROUP2_SCHMITT</ref>:</highlight></codeline>
<codeline lineno="3734"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1aa6c5c7b16e649d70e358b021ad0c469e" kindref="member">group2_schmitt</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3735"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3736"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdabbb8cd7178ae1d655a205c8197f5bbdd" kindref="member">GROUP2_SLEW</ref>:</highlight></codeline>
<codeline lineno="3737"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ab69800fef64ca3d55449eab4322e5090" kindref="member">group2_slew</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3738"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3739"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda954be78df39d339bc94729789f81a03e" kindref="member">GROUP3_DRIVE</ref>:</highlight></codeline>
<codeline lineno="3740"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1ae5c54d334e18338296557572deee7433" kindref="member">group3_drive</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3741"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3742"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdaff4e78fe8f024261c763dc3e3dccc717" kindref="member">GROUP3_SCHMITT</ref>:</highlight></codeline>
<codeline lineno="3743"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a7afc69623874f8b64614f2688f08033e" kindref="member">group3_schmitt</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3744"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3745"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdae7befb90d908e4035c69dfe8e783e29a" kindref="member">GROUP3_SLEW</ref>:</highlight></codeline>
<codeline lineno="3746"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a13e5b314e0a2c1e0a67f6bb31ac07f5a" kindref="member">group3_slew</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3747"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3748"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cdab3160717262b754c6d4895cd9a3daf2e" kindref="member">CHIP_TYPE</ref>:</highlight></codeline>
<codeline lineno="3749"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3750"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3751"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda412ffca781db3a099f287df487667d19" kindref="member">POWER_SAVE</ref>:</highlight></codeline>
<codeline lineno="3752"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1acbaa0dac427977d4f8fcd735a34bf2c3" kindref="member">powersave</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3753"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3754"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda54b3c39afc0140c234654d1738f0f18c" kindref="member">CLOCK_POLARITY</ref>:</highlight></codeline>
<codeline lineno="3755"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a55c072e8789a611a3842296ca1ac5171" kindref="member">clock_polarity</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3756"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3757"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1ecdc817b75811273206a5dededf4ddb" kindref="member">DATA_ORDER</ref>:</highlight></codeline>
<codeline lineno="3758"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a8a1f5de674bbd131e42e924ead65c617" kindref="member">data_order</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3759"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3760"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda1bc9ce65b7a27fdf832b69aef487b6b1" kindref="member">FLOW_CONTROL</ref>:</highlight></codeline>
<codeline lineno="3761"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a85d03dc6aa088d929eea3c7b6b7c5741" kindref="member">flow_control</ref><sp/>=<sp/>value;</highlight></codeline>
<codeline lineno="3762"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3763"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1ac40507f049c077d5bab6bf0e65c103cda381285b7c4454a1f04d43887b55a76b9" kindref="member">CHIP_SIZE</ref>:</highlight></codeline>
<codeline lineno="3764"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;EEPROM<sp/>Value<sp/>can&apos;t<sp/>be<sp/>changed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3765"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal"><sp/>:</highlight></codeline>
<codeline lineno="3766"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;Request<sp/>to<sp/>unknown<sp/>EEPROM<sp/>value&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3767"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3768"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="3769"><highlight class="normal">}</highlight></codeline>
<codeline lineno="3770"><highlight class="normal"></highlight></codeline>
<codeline lineno="3781" refid="group__libftdi_1ga92a449af4a1becc70e80e49f3c937bbd" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga92a449af4a1becc70e80e49f3c937bbd" kindref="member">ftdi_get_eeprom_buf</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/><ref refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" kindref="member">buf</ref>,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref>)</highlight></codeline>
<codeline lineno="3782"><highlight class="normal">{</highlight></codeline>
<codeline lineno="3783"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!ftdi<sp/>||<sp/>!(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>))</highlight></codeline>
<codeline lineno="3784"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;No<sp/>appropriate<sp/>structure&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3785"><highlight class="normal"></highlight></codeline>
<codeline lineno="3786"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!buf<sp/>||<sp/>size<sp/>&lt;<sp/>ftdi-&gt;eeprom-&gt;size)</highlight></codeline>
<codeline lineno="3787"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;Not<sp/>enough<sp/>room<sp/>to<sp/>store<sp/>eeprom&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3788"><highlight class="normal"></highlight></codeline>
<codeline lineno="3789"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Only<sp/>copy<sp/>up<sp/>to<sp/>FTDI_MAX_EEPROM_SIZE<sp/>bytes</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3790"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(size<sp/>&gt;<sp/><ref refid="ftdi__i_8h_1a0c61fd6cfc8b3ec904d270a7980e8f37" kindref="member">FTDI_MAX_EEPROM_SIZE</ref>)</highlight></codeline>
<codeline lineno="3791"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>size<sp/>=<sp/><ref refid="ftdi__i_8h_1a0c61fd6cfc8b3ec904d270a7980e8f37" kindref="member">FTDI_MAX_EEPROM_SIZE</ref>;</highlight></codeline>
<codeline lineno="3792"><highlight class="normal"></highlight></codeline>
<codeline lineno="3793"><highlight class="normal"><sp/><sp/><sp/><sp/>memcpy(buf,<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" kindref="member">buf</ref>,<sp/>size);</highlight></codeline>
<codeline lineno="3794"><highlight class="normal"></highlight></codeline>
<codeline lineno="3795"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="3796"><highlight class="normal">}</highlight></codeline>
<codeline lineno="3797"><highlight class="normal"></highlight></codeline>
<codeline lineno="3807" refid="group__libftdi_1gaad29bea74f6ae02ed757d2a39c060969" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gaad29bea74f6ae02ed757d2a39c060969" kindref="member">ftdi_set_eeprom_buf</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<sp/><ref refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" kindref="member">buf</ref>,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref>)</highlight></codeline>
<codeline lineno="3808"><highlight class="normal">{</highlight></codeline>
<codeline lineno="3809"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!ftdi<sp/>||<sp/>!(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>)<sp/>||<sp/>!buf)</highlight></codeline>
<codeline lineno="3810"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;No<sp/>appropriate<sp/>structure&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3811"><highlight class="normal"></highlight></codeline>
<codeline lineno="3812"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Only<sp/>copy<sp/>up<sp/>to<sp/>FTDI_MAX_EEPROM_SIZE<sp/>bytes</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3813"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(size<sp/>&gt;<sp/><ref refid="ftdi__i_8h_1a0c61fd6cfc8b3ec904d270a7980e8f37" kindref="member">FTDI_MAX_EEPROM_SIZE</ref>)</highlight></codeline>
<codeline lineno="3814"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>size<sp/>=<sp/><ref refid="ftdi__i_8h_1a0c61fd6cfc8b3ec904d270a7980e8f37" kindref="member">FTDI_MAX_EEPROM_SIZE</ref>;</highlight></codeline>
<codeline lineno="3815"><highlight class="normal"></highlight></codeline>
<codeline lineno="3816"><highlight class="normal"><sp/><sp/><sp/><sp/>memcpy(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" kindref="member">buf</ref>,<sp/>buf,<sp/>size);</highlight></codeline>
<codeline lineno="3817"><highlight class="normal"></highlight></codeline>
<codeline lineno="3818"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="3819"><highlight class="normal">}</highlight></codeline>
<codeline lineno="3820"><highlight class="normal"></highlight></codeline>
<codeline lineno="3832" refid="group__libftdi_1ga650df1dc49ec78f0ee58b1c4f2644fd9" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga650df1dc49ec78f0ee58b1c4f2644fd9" kindref="member">ftdi_read_eeprom_location</ref><sp/>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>eeprom_addr,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>*eeprom_val)</highlight></codeline>
<codeline lineno="3833"><highlight class="normal">{</highlight></codeline>
<codeline lineno="3834"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="3835"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3836"><highlight class="normal"></highlight></codeline>
<codeline lineno="3837"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" kindref="member">FTDI_DEVICE_IN_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1a9942db0e999f3b8549488d2346b55ad5" kindref="member">SIO_READ_EEPROM_REQUEST</ref>,<sp/>0,<sp/>eeprom_addr,<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)eeprom_val,<sp/>2,<sp/>ftdi-&gt;<ref refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" kindref="member">usb_read_timeout</ref>)<sp/>!=<sp/>2)</highlight></codeline>
<codeline lineno="3838"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;reading<sp/>eeprom<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3839"><highlight class="normal"></highlight></codeline>
<codeline lineno="3840"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="3841"><highlight class="normal">}</highlight></codeline>
<codeline lineno="3842"><highlight class="normal"></highlight></codeline>
<codeline lineno="3852" refid="group__libftdi_1gac157786fdf2e9c6b51dd9b4ddbb34d5f" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gac157786fdf2e9c6b51dd9b4ddbb34d5f" kindref="member">ftdi_read_eeprom</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="3853"><highlight class="normal">{</highlight></codeline>
<codeline lineno="3854"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="3855"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<ref refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" kindref="member">buf</ref>;</highlight></codeline>
<codeline lineno="3856"><highlight class="normal"></highlight></codeline>
<codeline lineno="3857"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="3858"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3859"><highlight class="normal"><sp/><sp/><sp/><sp/>buf<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" kindref="member">buf</ref>;</highlight></codeline>
<codeline lineno="3860"><highlight class="normal"></highlight></codeline>
<codeline lineno="3861"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/><ref refid="ftdi__i_8h_1a0c61fd6cfc8b3ec904d270a7980e8f37" kindref="member">FTDI_MAX_EEPROM_SIZE</ref>/2;<sp/>i++)</highlight></codeline>
<codeline lineno="3862"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3863"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(</highlight></codeline>
<codeline lineno="3864"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" kindref="member">FTDI_DEVICE_IN_REQTYPE</ref>,<ref refid="ftdi_8h_1a9942db0e999f3b8549488d2346b55ad5" kindref="member">SIO_READ_EEPROM_REQUEST</ref>,<sp/>0,<sp/>i,</highlight></codeline>
<codeline lineno="3865"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>buf+(i*2),<sp/>2,<sp/>ftdi-&gt;<ref refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" kindref="member">usb_read_timeout</ref>)<sp/>!=<sp/>2)</highlight></codeline>
<codeline lineno="3866"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;reading<sp/>eeprom<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3867"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3868"><highlight class="normal"></highlight></codeline>
<codeline lineno="3869"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>)</highlight></codeline>
<codeline lineno="3870"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref><sp/>=<sp/>0x80;</highlight></codeline>
<codeline lineno="3871"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/><sp/><sp/><sp/>Guesses<sp/>size<sp/>of<sp/>eeprom<sp/>by<sp/>comparing<sp/>halves</highlight></codeline>
<codeline lineno="3872"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>-<sp/>will<sp/>not<sp/>work<sp/>with<sp/>blank<sp/>eeprom<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3873"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(strrchr((</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)buf,<sp/>0xff)<sp/>==<sp/>((</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)buf<sp/>+<ref refid="ftdi__i_8h_1a0c61fd6cfc8b3ec904d270a7980e8f37" kindref="member">FTDI_MAX_EEPROM_SIZE</ref><sp/>-1))</highlight></codeline>
<codeline lineno="3874"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref><sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="3875"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(memcmp(buf,&amp;buf[0x80],0x80)<sp/>==<sp/>0)</highlight></codeline>
<codeline lineno="3876"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref><sp/>=<sp/>0x80;</highlight></codeline>
<codeline lineno="3877"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(memcmp(buf,&amp;buf[0x40],0x40)<sp/>==<sp/>0)</highlight></codeline>
<codeline lineno="3878"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref><sp/>=<sp/>0x40;</highlight></codeline>
<codeline lineno="3879"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3880"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref><sp/>=<sp/>0x100;</highlight></codeline>
<codeline lineno="3881"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="3882"><highlight class="normal">}</highlight></codeline>
<codeline lineno="3883"><highlight class="normal"></highlight></codeline>
<codeline lineno="3884"><highlight class="normal"></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="3885"><highlight class="comment"><sp/><sp/><sp/><sp/>ftdi_read_chipid_shift<sp/>does<sp/>the<sp/>bitshift<sp/>operation<sp/>needed<sp/>for<sp/>the<sp/>FTDIChip-ID</highlight></codeline>
<codeline lineno="3886"><highlight class="comment"><sp/><sp/><sp/><sp/>Function<sp/>is<sp/>only<sp/>used<sp/>internally</highlight></codeline>
<codeline lineno="3887"><highlight class="comment"><sp/><sp/><sp/><sp/>\internal</highlight></codeline>
<codeline lineno="3888"><highlight class="comment">*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3889"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>ftdi_read_chipid_shift(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>value)</highlight></codeline>
<codeline lineno="3890"><highlight class="normal">{</highlight></codeline>
<codeline lineno="3891"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>((value<sp/>&amp;<sp/>1)<sp/>&lt;&lt;<sp/>1)<sp/>|</highlight></codeline>
<codeline lineno="3892"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>((value<sp/>&amp;<sp/>2)<sp/>&lt;&lt;<sp/>5)<sp/>|</highlight></codeline>
<codeline lineno="3893"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>((value<sp/>&amp;<sp/>4)<sp/>&gt;&gt;<sp/>2)<sp/>|</highlight></codeline>
<codeline lineno="3894"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>((value<sp/>&amp;<sp/>8)<sp/>&lt;&lt;<sp/>4)<sp/>|</highlight></codeline>
<codeline lineno="3895"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>((value<sp/>&amp;<sp/>16)<sp/>&gt;&gt;<sp/>1)<sp/>|</highlight></codeline>
<codeline lineno="3896"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>((value<sp/>&amp;<sp/>32)<sp/>&gt;&gt;<sp/>1)<sp/>|</highlight></codeline>
<codeline lineno="3897"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>((value<sp/>&amp;<sp/>64)<sp/>&gt;&gt;<sp/>4)<sp/>|</highlight></codeline>
<codeline lineno="3898"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>((value<sp/>&amp;<sp/>128)<sp/>&gt;&gt;<sp/>2);</highlight></codeline>
<codeline lineno="3899"><highlight class="normal">}</highlight></codeline>
<codeline lineno="3900"><highlight class="normal"></highlight></codeline>
<codeline lineno="3911" refid="group__libftdi_1gab978a76c2cc0dbfbc1fd6350db848300" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1gab978a76c2cc0dbfbc1fd6350db848300" kindref="member">ftdi_read_chipid</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*chipid)</highlight></codeline>
<codeline lineno="3912"><highlight class="normal">{</highlight></codeline>
<codeline lineno="3913"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>a<sp/>=<sp/>0,<sp/>b<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="3914"><highlight class="normal"></highlight></codeline>
<codeline lineno="3915"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="3916"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3917"><highlight class="normal"></highlight></codeline>
<codeline lineno="3918"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" kindref="member">FTDI_DEVICE_IN_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1a9942db0e999f3b8549488d2346b55ad5" kindref="member">SIO_READ_EEPROM_REQUEST</ref>,<sp/>0,<sp/>0x43,<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)&amp;a,<sp/>2,<sp/>ftdi-&gt;<ref refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" kindref="member">usb_read_timeout</ref>)<sp/>==<sp/>2)</highlight></codeline>
<codeline lineno="3919"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3920"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>a<sp/>=<sp/>a<sp/>&lt;&lt;<sp/>8<sp/>|<sp/>a<sp/>&gt;&gt;<sp/>8;</highlight></codeline>
<codeline lineno="3921"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1ac07e5b0c33c6c87470b991700b5f49dd" kindref="member">FTDI_DEVICE_IN_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1a9942db0e999f3b8549488d2346b55ad5" kindref="member">SIO_READ_EEPROM_REQUEST</ref>,<sp/>0,<sp/>0x44,<sp/>(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*)&amp;b,<sp/>2,<sp/>ftdi-&gt;<ref refid="structftdi__context_1afa159483bb1153259ee7ceb3b45a2c9f" kindref="member">usb_read_timeout</ref>)<sp/>==<sp/>2)</highlight></codeline>
<codeline lineno="3922"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3923"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>b<sp/>=<sp/>b<sp/>&lt;&lt;<sp/>8<sp/>|<sp/>b<sp/>&gt;&gt;<sp/>8;</highlight></codeline>
<codeline lineno="3924"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>a<sp/>=<sp/>(a<sp/>&lt;&lt;<sp/>16)<sp/>|<sp/>(b<sp/>&amp;<sp/>0xFFFF);</highlight></codeline>
<codeline lineno="3925"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>a<sp/>=<sp/>ftdi_read_chipid_shift(a)<sp/>|<sp/>ftdi_read_chipid_shift(a&gt;&gt;8)&lt;&lt;8</highlight></codeline>
<codeline lineno="3926"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>|<sp/>ftdi_read_chipid_shift(a&gt;&gt;16)&lt;&lt;16<sp/>|<sp/>ftdi_read_chipid_shift(a&gt;&gt;24)&lt;&lt;24;</highlight></codeline>
<codeline lineno="3927"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*chipid<sp/>=<sp/>a<sp/>^<sp/>0xa5f0f7d1;</highlight></codeline>
<codeline lineno="3928"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="3929"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3930"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3931"><highlight class="normal"></highlight></codeline>
<codeline lineno="3932"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;read<sp/>of<sp/>FTDIChip-ID<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3933"><highlight class="normal">}</highlight></codeline>
<codeline lineno="3934"><highlight class="normal"></highlight></codeline>
<codeline lineno="3949" refid="group__libftdi_1ga5f2f678fc05cb8f92708fb1e5eb75100" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga5f2f678fc05cb8f92708fb1e5eb75100" kindref="member">ftdi_write_eeprom_location</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>eeprom_addr,</highlight></codeline>
<codeline lineno="3950"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>eeprom_val)</highlight></codeline>
<codeline lineno="3951"><highlight class="normal">{</highlight></codeline>
<codeline lineno="3952"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>chip_type_location;</highlight></codeline>
<codeline lineno="3953"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>chip_type;</highlight></codeline>
<codeline lineno="3954"><highlight class="normal"></highlight></codeline>
<codeline lineno="3955"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="3956"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3957"><highlight class="normal"></highlight></codeline>
<codeline lineno="3958"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom_addr<sp/>&lt;0x80)</highlight></codeline>
<codeline lineno="3959"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;Invalid<sp/>access<sp/>to<sp/>checksum<sp/>protected<sp/>area<sp/><sp/>below<sp/>0x80&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3960"><highlight class="normal"></highlight></codeline>
<codeline lineno="3961"><highlight class="normal"></highlight></codeline>
<codeline lineno="3962"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref>)</highlight></codeline>
<codeline lineno="3963"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3964"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea3865c3e28f68be594baec18ca30d2068" kindref="member">TYPE_BM</ref>:</highlight></codeline>
<codeline lineno="3965"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceaac65bc41b2313c45ee680cefacc84687" kindref="member">TYPE_2232C</ref>:</highlight></codeline>
<codeline lineno="3966"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>chip_type_location<sp/>=<sp/>0x14;</highlight></codeline>
<codeline lineno="3967"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3968"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea1beb33ef9cca96d6a05f8fd7f1fdb92f" kindref="member">TYPE_2232H</ref>:</highlight></codeline>
<codeline lineno="3969"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceab327f0179af90c5e1b2f447b6ebb426b" kindref="member">TYPE_4232H</ref>:</highlight></codeline>
<codeline lineno="3970"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>chip_type_location<sp/>=<sp/>0x18;</highlight></codeline>
<codeline lineno="3971"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3972"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385ceae4ab54d4dadd460324ae2417b50bcb8f" kindref="member">TYPE_232H</ref>:</highlight></codeline>
<codeline lineno="3973"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>chip_type_location<sp/>=<sp/>0x1e;</highlight></codeline>
<codeline lineno="3974"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="3975"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="3976"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-4,<sp/></highlight><highlight class="stringliteral">&quot;Device<sp/>can&apos;t<sp/>access<sp/>unprotected<sp/>area&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3977"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3978"><highlight class="normal"></highlight></codeline>
<codeline lineno="3979"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="group__libftdi_1ga650df1dc49ec78f0ee58b1c4f2644fd9" kindref="member">ftdi_read_eeprom_location</ref>(<sp/>ftdi,<sp/>chip_type_location&gt;&gt;1,<sp/>&amp;chip_type))</highlight></codeline>
<codeline lineno="3980"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-5,<sp/></highlight><highlight class="stringliteral">&quot;Reading<sp/>failed<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3981"><highlight class="normal"><sp/><sp/><sp/><sp/>fprintf(stderr,</highlight><highlight class="stringliteral">&quot;<sp/>loc<sp/>0x%04x<sp/>val<sp/>0x%04x\n&quot;</highlight><highlight class="normal">,<sp/>chip_type_location,chip_type);</highlight></codeline>
<codeline lineno="3982"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((chip_type<sp/>&amp;<sp/>0xff)<sp/>!=<sp/>0x66)</highlight></codeline>
<codeline lineno="3983"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="3984"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-6,<sp/></highlight><highlight class="stringliteral">&quot;EEPROM<sp/>is<sp/>not<sp/>of<sp/>93x66&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3985"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="3986"><highlight class="normal"></highlight></codeline>
<codeline lineno="3987"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,</highlight></codeline>
<codeline lineno="3988"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ftdi_8h_1aaea5180ed6c97e8ab5c3d50c16b04076" kindref="member">SIO_WRITE_EEPROM_REQUEST</ref>,<sp/>eeprom_val,<sp/>eeprom_addr,</highlight></codeline>
<codeline lineno="3989"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="3990"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;unable<sp/>to<sp/>write<sp/>eeprom&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="3991"><highlight class="normal"></highlight></codeline>
<codeline lineno="3992"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="3993"><highlight class="normal">}</highlight></codeline>
<codeline lineno="3994"><highlight class="normal"></highlight></codeline>
<codeline lineno="4005" refid="group__libftdi_1ga8cc9811660d1adfb4b30157c5ab26d5a" refkind="member"><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga8cc9811660d1adfb4b30157c5ab26d5a" kindref="member">ftdi_write_eeprom</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="4006"><highlight class="normal">{</highlight></codeline>
<codeline lineno="4007"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>usb_val,<sp/>status;</highlight></codeline>
<codeline lineno="4008"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i,<sp/>ret;</highlight></codeline>
<codeline lineno="4009"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*eeprom;</highlight></codeline>
<codeline lineno="4010"><highlight class="normal"></highlight></codeline>
<codeline lineno="4011"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="4012"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="4013"><highlight class="normal"></highlight></codeline>
<codeline lineno="4014"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a7a44fb7a64c3114f33561aa6214e5182" kindref="member">initialized_for_connected_device</ref><sp/>==<sp/>0)</highlight></codeline>
<codeline lineno="4015"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;EEPROM<sp/>not<sp/>initialized<sp/>for<sp/>the<sp/>connected<sp/>device&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="4016"><highlight class="normal"></highlight></codeline>
<codeline lineno="4017"><highlight class="normal"><sp/><sp/><sp/><sp/>eeprom<sp/>=<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a0b1c39033f225c7a2eb2f36b35f1f5d1" kindref="member">buf</ref>;</highlight></codeline>
<codeline lineno="4018"><highlight class="normal"></highlight></codeline>
<codeline lineno="4019"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>These<sp/>commands<sp/>were<sp/>traced<sp/>while<sp/>running<sp/>MProg<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4020"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ret<sp/>=<sp/><ref refid="group__libftdi_1ga266ccc351ea31289022063a8ae29edf4" kindref="member">ftdi_usb_reset</ref>(ftdi))<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="4021"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="4022"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ret<sp/>=<sp/><ref refid="group__libftdi_1ga396c3bf1435fb3317755868e28c47414" kindref="member">ftdi_poll_modem_status</ref>(ftdi,<sp/>&amp;status))<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="4023"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="4024"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((ret<sp/>=<sp/><ref refid="group__libftdi_1ga3e0227b0c7aa859d2d2afb5ffa4c8466" kindref="member">ftdi_set_latency_timer</ref>(ftdi,<sp/>0x77))<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="4025"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ret;</highlight></codeline>
<codeline lineno="4026"><highlight class="normal"></highlight></codeline>
<codeline lineno="4027"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6d45e714bee4069f7f44e184d6f5ce60" kindref="member">size</ref>/2;<sp/>i++)</highlight></codeline>
<codeline lineno="4028"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="4029"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>usb_val<sp/>=<sp/>eeprom[i*2];</highlight></codeline>
<codeline lineno="4030"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>usb_val<sp/>+=<sp/>eeprom[(i*2)+1]<sp/>&lt;&lt;<sp/>8;</highlight></codeline>
<codeline lineno="4031"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,</highlight></codeline>
<codeline lineno="4032"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ftdi_8h_1aaea5180ed6c97e8ab5c3d50c16b04076" kindref="member">SIO_WRITE_EEPROM_REQUEST</ref>,<sp/>usb_val,<sp/>i,</highlight></codeline>
<codeline lineno="4033"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="4034"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;unable<sp/>to<sp/>write<sp/>eeprom&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="4035"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="4036"><highlight class="normal"></highlight></codeline>
<codeline lineno="4037"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="4038"><highlight class="normal">}</highlight></codeline>
<codeline lineno="4039"><highlight class="normal"></highlight></codeline>
<codeline lineno="4054" refid="group__libftdi_1ga94630370ae389fb1189282fa0742f310" refkind="member"><highlight class="preprocessor">#define<sp/>MAGIC<sp/>0x55aa</highlight></codeline>
<codeline lineno="4055" refid="group__libftdi_1ga25eb9a83a925065b6c3b61b8f0565951" refkind="member"><highlight class="preprocessor"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="group__libftdi_1ga25eb9a83a925065b6c3b61b8f0565951" kindref="member">ftdi_erase_eeprom</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="4056"><highlight class="normal">{</highlight></codeline>
<codeline lineno="4057"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">short</highlight><highlight class="normal"><sp/>eeprom_value;</highlight></codeline>
<codeline lineno="4058"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL<sp/>||<sp/>ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref><sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="4059"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-2,<sp/></highlight><highlight class="stringliteral">&quot;USB<sp/>device<sp/>unavailable&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="4060"><highlight class="normal"></highlight></codeline>
<codeline lineno="4061"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi-&gt;<ref refid="structftdi__context_1a2e565f92e6a559d75cf4828ed46d0109" kindref="member">type</ref><sp/>==<sp/><ref refid="ftdi_8h_1a026dc3f26fbc7f5ef67c75f0739385cea60949f421ca5df446c9fb4322093bc8a" kindref="member">TYPE_R</ref>)</highlight></codeline>
<codeline lineno="4062"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="4063"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="4064"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="4065"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="4066"><highlight class="normal"></highlight></codeline>
<codeline lineno="4067"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1a8150b0280c2dff228abba700c4cec491" kindref="member">SIO_ERASE_EEPROM_REQUEST</ref>,</highlight></codeline>
<codeline lineno="4068"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>0,<sp/>0,<sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="4069"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;unable<sp/>to<sp/>erase<sp/>eeprom&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="4070"><highlight class="normal"></highlight></codeline>
<codeline lineno="4071"><highlight class="normal"></highlight></codeline>
<codeline lineno="4072"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>detect<sp/>chip<sp/>type<sp/>by<sp/>writing<sp/>0x55AA<sp/>as<sp/>magic<sp/>at<sp/>word<sp/>position<sp/>0xc0</highlight></codeline>
<codeline lineno="4073"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Chip<sp/>is<sp/>93x46<sp/>if<sp/>magic<sp/>is<sp/>read<sp/>at<sp/>word<sp/>position<sp/>0x00,<sp/>as<sp/>wraparound<sp/>happens<sp/>around<sp/>0x40</highlight></codeline>
<codeline lineno="4074"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Chip<sp/>is<sp/>93x56<sp/>if<sp/>magic<sp/>is<sp/>read<sp/>at<sp/>word<sp/>position<sp/>0x40,<sp/>as<sp/>wraparound<sp/>happens<sp/>around<sp/>0x80</highlight></codeline>
<codeline lineno="4075"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Chip<sp/>is<sp/>93x66<sp/>if<sp/>magic<sp/>is<sp/>only<sp/>read<sp/>at<sp/>word<sp/>position<sp/>0xc0*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4076"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,</highlight></codeline>
<codeline lineno="4077"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ftdi_8h_1aaea5180ed6c97e8ab5c3d50c16b04076" kindref="member">SIO_WRITE_EEPROM_REQUEST</ref>,<sp/><ref refid="group__libftdi_1ga94630370ae389fb1189282fa0742f310" kindref="member">MAGIC</ref>,<sp/>0xc0,</highlight></codeline>
<codeline lineno="4078"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>!=<sp/>0)</highlight></codeline>
<codeline lineno="4079"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-3,<sp/></highlight><highlight class="stringliteral">&quot;Writing<sp/>magic<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="4080"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="group__libftdi_1ga650df1dc49ec78f0ee58b1c4f2644fd9" kindref="member">ftdi_read_eeprom_location</ref>(<sp/>ftdi,<sp/>0x00,<sp/>&amp;eeprom_value))</highlight></codeline>
<codeline lineno="4081"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-4,<sp/></highlight><highlight class="stringliteral">&quot;Reading<sp/>failed<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="4082"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom_value<sp/>==<sp/><ref refid="group__libftdi_1ga94630370ae389fb1189282fa0742f310" kindref="member">MAGIC</ref>)</highlight></codeline>
<codeline lineno="4083"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="4084"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>=<sp/>0x46;</highlight></codeline>
<codeline lineno="4085"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="4086"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4087"><highlight class="normal"><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="4088"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="group__libftdi_1ga650df1dc49ec78f0ee58b1c4f2644fd9" kindref="member">ftdi_read_eeprom_location</ref>(<sp/>ftdi,<sp/>0x40,<sp/>&amp;eeprom_value))</highlight></codeline>
<codeline lineno="4089"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-4,<sp/></highlight><highlight class="stringliteral">&quot;Reading<sp/>failed<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="4090"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom_value<sp/>==<sp/><ref refid="group__libftdi_1ga94630370ae389fb1189282fa0742f310" kindref="member">MAGIC</ref>)</highlight></codeline>
<codeline lineno="4091"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>=<sp/>0x56;</highlight></codeline>
<codeline lineno="4092"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4093"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="4094"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="group__libftdi_1ga650df1dc49ec78f0ee58b1c4f2644fd9" kindref="member">ftdi_read_eeprom_location</ref>(<sp/>ftdi,<sp/>0xc0,<sp/>&amp;eeprom_value))</highlight></codeline>
<codeline lineno="4095"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-4,<sp/></highlight><highlight class="stringliteral">&quot;Reading<sp/>failed<sp/>failed&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="4096"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(eeprom_value<sp/>==<sp/><ref refid="group__libftdi_1ga94630370ae389fb1189282fa0742f310" kindref="member">MAGIC</ref>)</highlight></codeline>
<codeline lineno="4097"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>=<sp/>0x66;</highlight></codeline>
<codeline lineno="4098"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4099"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>{</highlight></codeline>
<codeline lineno="4100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ftdi-&gt;<ref refid="structftdi__context_1a0389f5e2d92fcba8d7ae5beffbf33a1b" kindref="member">eeprom</ref>-&gt;<ref refid="structftdi__eeprom_1a6f88bd208558f9900298fb59fd0ffa39" kindref="member">chip</ref><sp/>=<sp/>-1;</highlight></codeline>
<codeline lineno="4101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="4102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="4103"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="4104"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(libusb_control_transfer(ftdi-&gt;<ref refid="structftdi__context_1a1ea9e9fd3211a568779022befc0b3af8" kindref="member">usb_dev</ref>,<sp/><ref refid="ftdi_8h_1aff6baace3506ed18cfed6fd4695543fa" kindref="member">FTDI_DEVICE_OUT_REQTYPE</ref>,<sp/><ref refid="ftdi_8h_1a8150b0280c2dff228abba700c4cec491" kindref="member">SIO_ERASE_EEPROM_REQUEST</ref>,</highlight></codeline>
<codeline lineno="4105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>0,<sp/>0,<sp/>NULL,<sp/>0,<sp/>ftdi-&gt;<ref refid="structftdi__context_1ae98125557fc25c90953053a9992767cb" kindref="member">usb_write_timeout</ref>)<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="4106"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__libftdi_1ga885116a371f8fe4f6d03d1f943d8529b" kindref="member">ftdi_error_return</ref>(-1,<sp/></highlight><highlight class="stringliteral">&quot;unable<sp/>to<sp/>erase<sp/>eeprom&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="4107"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="4108"><highlight class="normal">}</highlight></codeline>
<codeline lineno="4109"><highlight class="normal"></highlight></codeline>
<codeline lineno="4117" refid="group__libftdi_1ga28c84d963760d7396e5a2992e63a9354" refkind="member"><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<ref refid="group__libftdi_1ga28c84d963760d7396e5a2992e63a9354" kindref="member">ftdi_get_error_string</ref><sp/>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structftdi__context" kindref="compound" tooltip="Main context structure for all libftdi functions.">ftdi_context</ref><sp/>*ftdi)</highlight></codeline>
<codeline lineno="4118"><highlight class="normal">{</highlight></codeline>
<codeline lineno="4119"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ftdi<sp/>==<sp/>NULL)</highlight></codeline>
<codeline lineno="4120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="stringliteral">&quot;&quot;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="4121"><highlight class="normal"></highlight></codeline>
<codeline lineno="4122"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ftdi-&gt;<ref refid="structftdi__context_1accc4dc90cea120d545faf82c6034d445" kindref="member">error_str</ref>;</highlight></codeline>
<codeline lineno="4123"><highlight class="normal">}</highlight></codeline>
<codeline lineno="4124"><highlight class="normal"></highlight></codeline>
<codeline lineno="4125"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>@}<sp/>end<sp/>of<sp/>doxygen<sp/>libftdi<sp/>group<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="C:/work/libftdi/libftdi1-1.0/src/ftdi.c"/>
  </compounddef>
</doxygen>
