Skip to content

Commit

Permalink
Updated doc
Browse files Browse the repository at this point in the history
  • Loading branch information
vdeconinck committed Oct 10, 2017
1 parent 0139ce2 commit 2c58424
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
4 changes: 2 additions & 2 deletions doc/class_q_c3_control-members.html
Expand Up @@ -103,8 +103,8 @@
<tr bgcolor="#f0f0f0"><td class="entry"><b>dmHiZ</b>() (defined in <a class="el" href="class_q_c3_control.html">QC3Control</a>)</td><td class="entry"><a class="el" href="class_q_c3_control.html">QC3Control</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>dp3300mV</b>() (defined in <a class="el" href="class_q_c3_control.html">QC3Control</a>)</td><td class="entry"><a class="el" href="class_q_c3_control.html">QC3Control</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>dp600mV</b>() (defined in <a class="el" href="class_q_c3_control.html">QC3Control</a>)</td><td class="entry"><a class="el" href="class_q_c3_control.html">QC3Control</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_q_c3_control.html#a93887f1365f5a06f60e897ede4e12e36">getMilliVoltage</a>()</td><td class="entry"><a class="el" href="class_q_c3_control.html">QC3Control</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_q_c3_control.html#aa28b3efc2a2b739898814394e0ce9be9">getVoltage</a>()</td><td class="entry"><a class="el" href="class_q_c3_control.html">QC3Control</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_q_c3_control.html#a93887f1365f5a06f60e897ede4e12e36">getMilliVoltage</a>()</td><td class="entry"><a class="el" href="class_q_c3_control.html">QC3Control</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_q_c3_control.html#aa28b3efc2a2b739898814394e0ce9be9">getVoltage</a>()</td><td class="entry"><a class="el" href="class_q_c3_control.html">QC3Control</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_q_c3_control.html#abe2212c6e95f18f0c6d40dd9ea9393ff">incrementVoltage</a>()</td><td class="entry"><a class="el" href="class_q_c3_control.html">QC3Control</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_q_c3_control.html#ac29cca4304315f49c5e38c03c15fc7c2">QC3Control</a>(byte DpPin, byte DmPin)</td><td class="entry"><a class="el" href="class_q_c3_control.html">QC3Control</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_q_c3_control.html#a4b87bfe1cf5233c5c009791bf96b03f4">QC3Control</a>(byte DpPin, byte DmPin, byte DmGndPin)</td><td class="entry"><a class="el" href="class_q_c3_control.html">QC3Control</a></td><td class="entry"></td></tr>
Expand Down
16 changes: 0 additions & 16 deletions doc/class_q_c3_control.html
Expand Up @@ -355,9 +355,6 @@ <h2 class="memtitle"><span class="permalink"><a href="#a93887f1365f5a06f60e897ed

<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">unsigned int QC3Control::getMilliVoltage </td>
Expand All @@ -366,11 +363,6 @@ <h2 class="memtitle"><span class="permalink"><a href="#a93887f1365f5a06f60e897ed
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">

<p>Return the voltage that the charger is supposed to currently provide. </p>
Expand All @@ -386,9 +378,6 @@ <h2 class="memtitle"><span class="permalink"><a href="#aa28b3efc2a2b739898814394

<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">double QC3Control::getVoltage </td>
Expand All @@ -397,11 +386,6 @@ <h2 class="memtitle"><span class="permalink"><a href="#aa28b3efc2a2b739898814394
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">

<p>(deprecated - use <a class="el" href="class_q_c3_control.html#a93887f1365f5a06f60e897ede4e12e36" title="Return the voltage that the charger is supposed to currently provide. ">getMilliVoltage()</a>) Return the voltage that the charger is supposed to currently provide. </p>
Expand Down
20 changes: 11 additions & 9 deletions doc/index.html
Expand Up @@ -102,8 +102,8 @@ <h2>Differences between QC2Control and <a class="el" href="class_q_c3_control.ht
</ul>
<p>Both circuits are supported by the library, but basically, I suggest you first try the recommended circuit, and if your QC3 charger refuses to generate anything else than 5V, then try with the legacy circuit, changing the constructor in the code accordingly.</p>
<h2>Class A vs Class B</h2>
<p>QC3.0 class A is mostly used for phone chargers and outputs up to 12V. It is supported by <a class="el" href="class_q_c3_control.html" title="Main class of the QC3Control-library. ">QC3Control</a> and fully tested. Possible voltages are 5V (USB default), 9V and 12V, plus any value between 3.6V and 12V obtained by 200mV steps from 5V (or from the previous voltage reached using setMilliVoltage()).</p>
<p>QC3.0 class B is more targeted at laptops and can output up to 20V. <b>WARNING:</b> this means that the Arduino will be <b>destroyed</b> if powered from the USB output voltage using one of the circuits below, and the use of a separate USB output, power supply or voltage regulator is mandatory. Apart from that, it is now supported by <a class="el" href="class_q_c3_control.html" title="Main class of the QC3Control-library. ">QC3Control</a> although testing was limited, and is enabled by calling begin(true). Possible voltages are then 5V (USB default), 9V, 12V and 20V, plus any value between 3.6V and 20V obtained by 200mV steps from 5V (or from the previous voltage reached using setMilliVoltage()).</p>
<p>QC3.0 class A is the most common, is mainly used for phone chargers and outputs up to 12V. It is supported by <a class="el" href="class_q_c3_control.html" title="Main class of the QC3Control-library. ">QC3Control</a> and fully tested. Possible voltages are 5V (USB default), 9V and 12V, plus any value between 3.6V and 12V obtained by 200mV steps from 5V (or from the previous voltage reached using setMilliVoltage()).</p>
<p>QC3.0 class B is more targeted at laptops and can output up to 20V. <b>WARNING:</b> this means that the Arduino will be <b>destroyed</b> if powered directly from the controlled output voltage, and the use of a separate USB output, power supply or voltage regulator is mandatory. That being said, class B is now supported by <a class="el" href="class_q_c3_control.html" title="Main class of the QC3Control-library. ">QC3Control</a> although testing was limited, and it is enabled by calling begin(true) instead of begin(). Possible voltages are then 5V (USB default), 9V, 12V and 20V, plus any value between 3.6V and 20V obtained by 200mV steps from 5V (or from the previous voltage reached using setMilliVoltage()).</p>
<h3>How to connect?</h3>
<p>As indicated above, the library supports the 2 following configurations. In all cases, all you need is a few resistors.</p>
<p>a) Recommended "2-wire" circuit.</p>
Expand Down Expand Up @@ -160,28 +160,30 @@ <h3>Update</h3>
</ol>
<p>Alternatively you can download it from GitHub and simply unpack it over the current version (or remove the old version first).</p>
<h2>Usage</h2>
<p>Just see this simple sketch (assuming the recommended circuit is used) </p><div class="fragment"><div class="line">{C++}</div><div class="line">#include &lt;QC3Control.h&gt;</div><div class="line"></div><div class="line">//Pin 4 for Data+</div><div class="line">//Pin 5 for Data-</div><div class="line">//See How to connect in the documentation for more details.</div><div class="line">QC3Control quickCharge(4, 5);</div><div class="line"></div><div class="line">void setup() {</div><div class="line"> //Optional</div><div class="line"> //quickCharge.begin();</div><div class="line"></div><div class="line"> //set voltage to 12V</div><div class="line"> quickCharge.set12V();</div><div class="line"></div><div class="line"> delay(1000);</div><div class="line">}</div><div class="line"></div><div class="line">void loop() {</div><div class="line"> //And you can change it on the fly</div><div class="line"> delay(1000);</div><div class="line"> quickCharge.set9V();</div><div class="line"> delay(1000);</div><div class="line"> quickCharge.set5V();</div><div class="line"> delay(1000);</div><div class="line"> quickCharge.setVoltage(6);</div><div class="line"> delay(1000);</div><div class="line"> for (int i = 0; i &lt; 10; i++) quickCharge.decrementVoltage();</div><div class="line"> delay(1000);</div><div class="line"> quickCharge.set12V();</div><div class="line">}</div></div><!-- fragment --><p> <b>Please note</b>, delay() here is just used to demonstrate. Better not to stop the complete program with delay()'s.</p>
<p>If you can, place the call to begin() (or setVoltage()) at the end of the setup(). The handshake needs a fixed time but that already starts when the QC 3.0 source (and thus the Arduino) is turned on. So by doing begin() last you can do stuff while waiting.</p>
<p>Just see this simple sketch (assuming the recommended circuit is used) </p><div class="fragment"><div class="line">{C++}</div><div class="line">#include &lt;QC3Control.h&gt;</div><div class="line"></div><div class="line">//Pin 4 for Data+</div><div class="line">//Pin 5 for Data-</div><div class="line">//See How to connect in the documentation for more details.</div><div class="line">QC3Control quickCharge(4, 5);</div><div class="line"></div><div class="line">void setup() {</div><div class="line"> //Optional</div><div class="line"> //quickCharge.begin();</div><div class="line"></div><div class="line"> //set voltage to 12V</div><div class="line"> quickCharge.set12V();</div><div class="line"></div><div class="line"> delay(1000);</div><div class="line">}</div><div class="line"></div><div class="line">void loop() {</div><div class="line"> //And you can change it on the fly</div><div class="line"> delay(1000);</div><div class="line"> quickCharge.set9V();</div><div class="line"> delay(1000);</div><div class="line"> quickCharge.set5V();</div><div class="line"> delay(1000);</div><div class="line"> quickCharge.setMilliVoltage(6000);</div><div class="line"> delay(1000);</div><div class="line"> for (int i = 0; i &lt; 10; i++) quickCharge.decrementVoltage();</div><div class="line"> delay(1000);</div><div class="line"> quickCharge.set12V();</div><div class="line">}</div></div><!-- fragment --><p> <b>Please note</b>, delay() here is just used to demonstrate. Better not to stop the complete program with delay()'s.</p>
<p>If you can, place the call to begin() (or setMilliVoltage()) at the end of the setup(). The handshake needs a fixed time but that already starts when the QC 3.0 source (and thus the Arduino) is turned on. So by doing begin() last you can do stuff while waiting.</p>
<h2>Quick start</h2>
<p>Note: this is just a partial overview. For full documentation, please see the next section.</p>
<h3>Constructors</h3>
<h4><a class="el" href="class_q_c3_control.html" title="Main class of the QC3Control-library. ">QC3Control(byte DpPin, byte DmPin)</a></h4>
<p>[QC2 or QC3 power source] This will create a <a class="el" href="class_q_c3_control.html" title="Main class of the QC3Control-library. ">QC3Control</a> object to control the voltage of the Quick Charge source when using the recommended "2-wire" circuit. DpPin is the pin number for the Data+ side, DmPin is the pin number for the Data- side. See <a href="#how-to-connect"><b>How to connect?</b></a>.</p>
<h4><a class="el" href="class_q_c3_control.html" title="Main class of the QC3Control-library. ">QC3Control(byte DpPin, byte DmPin, byte DmGndPin)</a></h4>
<p>[QC2 or QC3 power source] This will create a <a class="el" href="class_q_c3_control.html" title="Main class of the QC3Control-library. ">QC3Control</a> object to control the voltage of the Quick Charge 3.0 source when using the legacy "3-wire" circuit. DpPin is the pin number for the Data+ side, DmPin is the pin number for the upper resistor of the Data- side and DmGndPin is the pin number for the lower resistor of the Data- side. See <a href="#how-to-connect"><b>How to connect?</b></a>.</p>
<h3>Methods</h3>
<h4>void .begin()</h4>
<p>[QC2 or QC3 power source] Just does the handshake with the Quick Charge 3.0 source so it will accept commands for different voltage. It's not mandatory to call begin(), if it's not called before setting a voltage the library will call begin() at that moment.</p>
<p>[QC2 or QC3 power source] Just does the handshake with a Quick Charge 3.0 (class A) source so it will accept commands for different voltages. It's not mandatory to call begin(), if it's not called before setting a voltage the library will call begin() at that moment.</p>
<h4>void .set5V(), .set9V() and .set12V()</h4>
<p>[QC2 or QC3 power source] Sets the desired voltage of the QC source using discrete (QC2) mode.</p>
<h4>void .setVoltage(double volt), setMilliVoltage(unsigned int milliVolt)</h4>
<h4>void setMilliVoltage(unsigned int milliVolt)</h4>
<p>[QC3 power source only] Sets the desired voltage of the QC3.0 source using continuous (QC3) mode. Setting an unreachable voltage will result in the closest supported voltage.</p>
<h4>double getVoltage(), unsigned int getMilliVoltage()</h4>
<h4>unsigned int getMilliVoltage()</h4>
<p>[QC2 or QC3 power source] Return the last voltage that was requested, or the closest one in the range 3.6 - 12V.</p>
<p>Note that these methods return the value the library requested, not the actual voltage which may be different if the power source did not behave as exepected.</p>
<p><b>Important:</b> Note that this method returns the value the library requested, not the actual voltage which may be different if the power source did not behave as exepected.</p>
<h4>void incrementVoltage(), decrementVoltage()</h4>
<p>[QC3 power source only] Requests an increment or decrement of the voltage by 0.2V</p>
<h2>Full documentation</h2>
<p>Full documentation of all the methods of this library can be found inside the library located in <code><a class="el" href="class_q_c3_control.html" title="Main class of the QC3Control-library. ">QC3Control</a>\doc</code>. Just open <code><a class="el" href="class_q_c3_control.html" title="Main class of the QC3Control-library. ">QC3Control</a>\doc\index.html</code> to see all methods of <a class="el" href="class_q_c3_control.html" title="Main class of the QC3Control-library. ">QC3Control</a>.</p>
<p>You can also view the documentation via <a href="https://htmlpreview.github.io/?https://github.com/vdeconinck/QC3Control/master/doc/index.html">GitHub HTML Preview</a>.</p>
<p>You can also view the documentation online via <a href="https://htmlpreview.github.io/?https://github.com/vdeconinck/QC3Control/master/doc/index.html">GitHub HTML Preview</a>.</p>
<p>This documentation is powered by <a href="http://www.doxygen.org/">Doxygen</a> and thus fully extracted from the source files. This README.md is also used as Main Page.</p>
<h2>FAQ</h2>
<h3>Can I control more the one Quick Charge source with a single Arduino?</h3>
Expand Down

0 comments on commit 2c58424

Please sign in to comment.