ykushcmd-reference-manual-ykush3.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <div class="reference_software_manual_version">
  2. This manual page refers to software version <b>v1.2.0</b>.
  3. </div>
  4. <div class="reference_software_manual_index">
  5. <ul>
  6. <li><a href="#command_list">Command list</a></li>
  7. <li><a href="#ykush3_man_important_links">Important links</a></li>
  8. </ul>
  9. </div>
  10. <div class="reference_software_manual_body">
  11. <!--
  12. COMMAND LIST
  13. -->
  14. <h1 id="command_list">Command list</h1>
  15. <div>
  16. <ul>
  17. <li><a href="#downstream_port_commands">Downstream port commands</a></li>
  18. <li><a href="#5V_output_port_commands">5V output switched port control commands</a></li>
  19. <li><a href="#gpio_ctrl_config_commands">GPIO control configuration commands</a></li>
  20. <li><a href="#gpio_read_write_commands">GPIO Read/Write commands</a></li>
  21. <li><a href="#ykush3_downstream_port_config_commands">Downstream ports configuration commands</a></li>
  22. <li><a href="#ykush3_i2c_commands">I2C interface commands</a></li>
  23. <li><a href="#ykush3_uart_commands">UART interface commands</a></li>
  24. <li><a href="#ykush3_reset_commands">Reset command</a></li>
  25. <li><a href="#ykush3_versioning_commands">Versioning commands</a></li>
  26. </ul>
  27. </div>
  28. <div>
  29. <p>Legend:</p>
  30. <p>
  31. &lt;&gt; Variable<br>
  32. [] Optional parameter<br>
  33. &gt; Command line
  34. </p>
  35. </div>
  36. <div>
  37. <!-- 1. Downstream port commands -->
  38. <h2 id="downstream_port_commands">Downstream port commands</h2>
  39. <p>The structure of the downstream port commands is as follows.</p>
  40. <p class="command_line">ykushcmd ykush3 [-s &lt;serial_number&gt;] -&lt;action&gt; &lt;port&gt;</p>
  41. <p>Where:</p>
  42. <table>
  43. <tr>
  44. <td>serial_number</td>
  45. <td>Serial number of a board. This is an optional parameter useful for when multiple boards are attached to the same host.</td>
  46. </tr>
  47. <tr>
  48. <td>action</td>
  49. <td>
  50. u &rarr; Turn ON/UP the downstream<br>
  51. d &rarr; Turn OFF/DOWN the downstream<br>
  52. g &rarr; Get downstream port status<br>
  53. l &rarr; List boards attached<br>
  54. </td>
  55. </tr>
  56. <tr>
  57. <td>port</td>
  58. <td>1, 2 or 3.</td>
  59. </tr>
  60. </table>
  61. <p>Some examples:</p>
  62. <p>Turn OFF the downstream port 1 (if only one YKUSH3 board is attached).</p>
  63. <p class="command_line">ykushcmd ykush3 -d 1<p>
  64. <p>Turn OFF the downstream port 1 of the board with serial number YKB00001.</p>
  65. <p class="command_line">ykushcmd ykush3 -s YKB00001 -d 1</p>
  66. <p>Get status of downstream port 2</p>
  67. <p class="command_line">ykushcmd ykush3 -g 2<p>
  68. <p>List attached YKUSH3 boards</p>
  69. <p class="command_line">ykushcmd ykush3 -l</p>
  70. <!-- 2. 5V output switched port control commands -->
  71. <h2 id="5V_output_port_commands">5V output switched port control commands</h2>
  72. <p>The structure of commands:</p>
  73. <p class="command_line">ykushcmd ykush3 [-s &lt;serial_number&gt;] -&lt;action&gt;</p>
  74. <p>Where:</p>
  75. <table>
  76. <tr>
  77. <td>serial_number</td>
  78. <td>
  79. Serial number of a board.
  80. This is an optional parameter useful for when multiple boards are attached to the same host.
  81. </td>
  82. </tr>
  83. <tr>
  84. <td>action</td>
  85. <td>
  86. on &rarr; Turn ON.<br>
  87. off &rarr; Turn OFF.
  88. </td>
  89. </tr>
  90. </table>
  91. <p>Some examples:</p>
  92. <p>Turn OFF the 5V Out port (if only one YKUSH3 board is attached).</p>
  93. <p class="command_line">ykushcmd ykush3 -off</p>
  94. <p>Turn ON the 5V Out port of the board with serial number YKB00001.</p>
  95. <p class="command_line">ykushcmd ykush3 -s YKB00001 -on</p>
  96. <!-- GPIO control configuration commands -->
  97. <h2 id="gpio_ctrl_config_commands">GPIO control configuration commands</h2>
  98. <p>
  99. Commands to enable/disable the ability to control the downstream ports using the inputs of the board GPIO pins.
  100. </p>
  101. <p>Structure of commands:</p>
  102. <p class="command_line">ykushcmd ykush3 [-s &lt;serial_number&gt;] --gpio &lt;action&gt;</p>
  103. <p>Where:</p>
  104. <table>
  105. <tr>
  106. <td>serial_number</td>
  107. <td>
  108. Serial number of a board. This is an optional parameter
  109. useful for when multiple boards are attached to the
  110. same host.
  111. </td>
  112. </tr>
  113. <tr>
  114. <td>action</td>
  115. <td>
  116. enable &rarr; Enable the GPIO control of the downstream ports.<br>
  117. disable &rarr; Disable the GPIO control of the downstream ports.
  118. </td>
  119. </tr>
  120. </table>
  121. <!-- GPIO Read/Write commands -->
  122. <h2 id="gpio_read_write_commands">GPIO Read/Write commands</h2>
  123. <p>
  124. Commands to read/write the logical value of the GPIO pins.
  125. </p>
  126. <p>Structure of commands:</p>
  127. <p class="command_line">ykushcmd ykush3 [-s &lt;serial_number&gt;] -&lt;action&gt; &lt;gpio&gt; &lt;value&gt;</p>
  128. <p>Where:</p>
  129. <table>
  130. <tr>
  131. <td>serial_number</td>
  132. <td>
  133. Serial number of a board. This is an optional parameter
  134. useful for when multiple boards are attached to the
  135. same host.
  136. </td>
  137. </tr>
  138. <tr>
  139. <td>action</td>
  140. <td>
  141. w &rarr; Write to GPIO.<br>
  142. r &rarr; Read from GPIO.
  143. </td>
  144. </tr>
  145. <tr>
  146. <td>gpio</td>
  147. <td>
  148. 1 &rarr; GPIO 1.<br>
  149. 2 &rarr; GPIO 2.<br>
  150. 3 &rarr; GPIO 3.<br>
  151. </td>
  152. </tr>
  153. <tr>
  154. <td>value</td>
  155. <td>
  156. 1 &rarr; Set GPIO to High.<br>
  157. 0 &rarr; Set GPIO to Low.
  158. </td>
  159. </tr>
  160. </table>
  161. <p>Some examples:</p>
  162. <p>Set GPIO 2 to high (1).</p>
  163. <p class="command_line">ykushcmd ykush3 -w 2 1<p>
  164. <p>Read the GPIO 2.<p>
  165. <p class="command_line">ykushcmd ykush3 -r 2<p>
  166. <p>NOTE: For Windows operating systems add the .exe extension when calling the ykushcmd command.</p>
  167. <!-- 4. Downstream ports configuration commands -->
  168. <h2 id="ykush3_downstream_port_config_commands">Downstream ports configuration commands</h2>
  169. <p>
  170. Sets the default state of the downstream ports on power-on.
  171. </p>
  172. <p>Structure of commands:</p>
  173. <p class="command_line">ykushcmd ykush3 [-s &lt;serial_number&gt;] -c &lt;port&gt; &lt;value&gt;</p>
  174. <p>Where:</p>
  175. <table>
  176. <tr>
  177. <td>serial_number</td>
  178. <td>
  179. Serial number of a board. This is an optional parameter
  180. useful for when multiple boards are attached to the
  181. same host.
  182. </td>
  183. </tr>
  184. <tr>
  185. <td>port</td>
  186. <td>1, 2 or 3.</td>
  187. </tr>
  188. <tr>
  189. <td>value</td>
  190. <td>
  191. 1 &rarr; ON state.
  192. 0 &rarr; OFF state.
  193. </td>
  194. </tr>
  195. </table>
  196. <p>Some examples:</p>
  197. <p>Set default state of downstream port 2 at power-on to ON.</p>
  198. <p class="command_line">ykushcmd ykush3 -c 2 1<p>
  199. <p>Set default state of downstream port 2 at power-on to OFF.</p>
  200. <p class="command_line">ykushcmd ykush3 -c 2 0<p>
  201. <!-- I2C control interface commands -->
  202. <h2 id="ykush3_i2c_commands">I2C interface commands</h2>
  203. <p>
  204. YKUSH3 boards have an I2C interface alowing them to be connected to a
  205. I2C bus and communicate to other devices in that bus.
  206. The board can be configured in I2C slave mode, for other I2C devices to be
  207. able to control the switching of the downstream ports, or in master mode
  208. to be able to control other I2C devices.
  209. </p>
  210. <p>
  211. To configure the board to operate I2C in slave mode and be controlable
  212. by a master I2C device the user must enable the
  213. <i>i2C control interface</i> feature.
  214. </p>
  215. <p>
  216. When the board is configure with I2C in master mode it provides a
  217. USB to I2C gateway funcionality.
  218. With this USB to I2C gateway functionality a user can communicate with
  219. a slave I2C device, connected in the same I2C bus than YKUSH3 board,
  220. from the command line of the PC using <i>ykushcmd</i> application.
  221. </p>
  222. <h3>Command usage</h3>
  223. <p class="command_line">
  224. ykushcmd ykush3 [OPTION]...
  225. </p>
  226. <p>The following options are available:</p>
  227. <table>
  228. <tr>
  229. <td>--i2c-enable-control</td>
  230. <td>
  231. Enables I2C as a control interface.
  232. This will configure I2C in slave mode.
  233. </td>
  234. </tr>
  235. <tr>
  236. <td>--i2c-disable-control</td>
  237. <td>
  238. Disables I2C as a control interface.
  239. </td>
  240. </tr>
  241. <tr>
  242. <td>--i2c-enable-gateway</td>
  243. <td>
  244. Enables USB to I2C gateway functionality.
  245. This will configure I2C in master mode.
  246. </td>
  247. </tr>
  248. <tr>
  249. <td>--i2c-disable-gateway</td>
  250. <td>
  251. Disables USB to I2C gateway functionality.
  252. </td>
  253. </tr>
  254. <tr>
  255. <td>--i2c-set-address &lt;address&gt;</td>
  256. <td>
  257. Set the board I2C address.
  258. The <i>address</i> should be in hexadecimal representation
  259. with a <b>0x</b> prefix.
  260. Example: 0x1F for 7-bit address 0011111.
  261. This address is only used when the board is configured
  262. with I2C in slave mode.
  263. </td>
  264. </tr>
  265. <tr>
  266. <td>--i2c-write &lt;dev_address&gt; &lt;num_bytes&gt; &lt;byte1&gt;...</td>
  267. <td>
  268. Writes <i>num_bytes</i> (byte1...) to the I2C
  269. slave device with address <i>dev_address</i>.
  270. <i>dev_address</i> is in hexadecimal representation
  271. with a <b>0x</b> prefix.
  272. <i>num_bytes</i> is in decimal representation.
  273. <i>byte1...byteN</i> is in hexadecimal representation
  274. with a <b>0x</b> prefix.
  275. </td>
  276. </tr>
  277. <tr>
  278. <td>--i2c-read &lt;dev_address&gt; &lt;num_bytes&gt;</td>
  279. <td>
  280. Reads <i>num_bytes</i>from the I2C
  281. slave device with address <i>dev_address</i>.
  282. </td>
  283. </tr>
  284. <tr>
  285. <td>--i2c-usb-serial &lt;serial_number&gt;</td>
  286. <td>
  287. Serial number of the YKUSH3 board.
  288. This is an optional parameter useful for when multiple
  289. YKUSH3 boards are attached to the same host.
  290. </td>
  291. </tr>
  292. </table>
  293. <h3>Examples</h3>
  294. <p>Enable I2C control interface:</p>
  295. <p class="command_line">ykushcmd ykush3 --i2c-enable-control<p>
  296. <p>Set the board I2C address to 0x1A:</p>
  297. <p class="command_line">ykushcmd ykush3 --i2c-set-address 0x1A<p>
  298. <p>Write bytes 0x12 0xAA 0x2F to I2C device with address 0x07:</p>
  299. <p class="command_line">ykushcmd ykush3 --i2c-write 0x07 3 0x12 0xAA 0x2F<p>
  300. <!-- Reset command -->
  301. <h2 id="ykush3_reset_commands">Reset command</h2>
  302. <p>
  303. Triggers a reset of the board.
  304. </p>
  305. <p>Structure of command:</p>
  306. <p class="command_line">ykushcmd ykush3 [-s &lt;serial_number&gt;] --reset</p>
  307. <p>Examples:</p>
  308. <p>Reset the attached board.</p>
  309. <p class="command_line">ykushcmd ykush3 --reset<p>
  310. <p>Reset the attached board with serial number YK00001.</p>
  311. <p class="command_line">ykushcmd ykush3 -s YK00001 --reset<p>
  312. <!-- Versioning commands -->
  313. <h2 id="ykush3_versioning_commands">Versioning commands</h2>
  314. <p>
  315. Get version of the firmware loaded in the board.
  316. </p>
  317. <h3>Command usage</h3>
  318. <p class="command_line">
  319. ykushcmd ykush3 [OPTION]
  320. </p>
  321. <p>The following options are available:</p>
  322. <table>
  323. <tr>
  324. <td>--version-bootloader</td>
  325. <td>Get bootloader version from board.</td>
  326. </tr>
  327. <tr>
  328. <td>--version-firmware</td>
  329. <td>Get firmware version from board.</td>
  330. </tr>
  331. </table>
  332. <h3>Examples</h3>
  333. <p>Get bootloader version:</p>
  334. <p class="command_line">ykushcmd ykush3 --version-bootloader<p>
  335. <p>Get firmware version:</p>
  336. <p class="command_line">ykushcmd ykush3 --version-firmware<p>
  337. </div>
  338. <!--
  339. #ykush3_man_important_links
  340. -->
  341. <h1 id="ykush3_man_important_links">Important links</h1>
  342. <div>
  343. <ul>
  344. <li><a class="inlineLink" href="https://www.yepkit.com/product/300110/YKUSH3" target="_blank">YKUSH3 product page</a></li>
  345. <li><a class="inlineLink" href="https://www.yepkit.com/learn/tutorial/setup_guide/ykush3-i2c-control-interface" target="_blank">How to control the YKUSH3 boards using the I2C interface</a></li>
  346. </ul>
  347. </div>
  348. </div>