489 lines
26 KiB
HTML
489 lines
26 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||
|
<title>CTHN.de - LEDCube - commandline client: ledcube.h File Reference</title>
|
||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||
|
<script type="text/javascript" src="search/search.js"></script>
|
||
|
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
|
||
|
</head>
|
||
|
<body onload='searchBox.OnSelectItem(0);'>
|
||
|
<!-- Generated by Doxygen 1.7.4 -->
|
||
|
<script type="text/javascript"><!--
|
||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||
|
--></script>
|
||
|
<div id="top">
|
||
|
<div id="titlearea">
|
||
|
<table cellspacing="0" cellpadding="0">
|
||
|
<tbody>
|
||
|
<tr style="height: 56px;">
|
||
|
<td style="padding-left: 0.5em;">
|
||
|
<div id="projectname">CTHN.de - LEDCube - commandline client</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div id="navrow1" class="tabs">
|
||
|
<ul class="tablist">
|
||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||
|
<li id="searchli">
|
||
|
<div id="MSearchBox" class="MSearchBoxInactive">
|
||
|
<span class="left">
|
||
|
<img id="MSearchSelect" src="search/mag_sel.png"
|
||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||
|
alt=""/>
|
||
|
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
||
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||
|
</span><span class="right">
|
||
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||
|
</span>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div id="navrow2" class="tabs2">
|
||
|
<ul class="tablist">
|
||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="header">
|
||
|
<div class="summary">
|
||
|
<a href="#define-members">Defines</a> |
|
||
|
<a href="#func-members">Functions</a> |
|
||
|
<a href="#var-members">Variables</a> </div>
|
||
|
<div class="headertitle">
|
||
|
<div class="title">ledcube.h File Reference</div> </div>
|
||
|
</div>
|
||
|
<div class="contents">
|
||
|
<div class="textblock"><code>#include <stdio.h></code><br/>
|
||
|
<code>#include <usb.h></code><br/>
|
||
|
<code>#include "<a class="el" href="opendevice_8h_source.html">opendevice.h</a>"</code><br/>
|
||
|
<code>#include "../firmware/globals.h"</code><br/>
|
||
|
<code>#include "../firmware/requests.h"</code><br/>
|
||
|
<code>#include "../firmware/usbconfig.h"</code><br/>
|
||
|
</div><div class="textblock"><div class="dynheader">
|
||
|
Include dependency graph for ledcube.h:</div>
|
||
|
<div class="dyncontent">
|
||
|
<div class="center"><img src="ledcube_8h__incl.png" border="0" usemap="#ledcube_8h" alt=""/></div>
|
||
|
<map name="ledcube_8h" id="ledcube_8h">
|
||
|
<area shape="rect" id="node7" href="opendevice_8h.html" title="opendevice.h" alt="" coords="71,83,169,112"/></map>
|
||
|
</div>
|
||
|
</div><div class="textblock"><div class="dynheader">
|
||
|
This graph shows which files directly or indirectly include this file:</div>
|
||
|
<div class="dyncontent">
|
||
|
<div class="center"><img src="ledcube_8h__dep__incl.png" border="0" usemap="#ledcube_8hdep" alt=""/></div>
|
||
|
<map name="ledcube_8hdep" id="ledcube_8hdep">
|
||
|
<area shape="rect" id="node3" href="ledcube_8c.html" title="ledcube.c" alt="" coords="5,83,83,112"/></map>
|
||
|
</div>
|
||
|
</div>
|
||
|
<p><a href="ledcube_8h_source.html">Go to the source code of this file.</a></p>
|
||
|
<table class="memberdecls">
|
||
|
<tr><td colspan="2"><h2><a name="define-members"></a>
|
||
|
Defines</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#ac70f88eda20bac5cf379d1512ad5f2ab">NOT_CONNECTED_ERROR</a>   -1</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#a9346e6751e831ccf0560c7a1152a2fab">DEVICE_NOT_FOUND_ERROR</a>   -2</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#a685f5d598cb43342b6357ced7e77c380">SUCCESSFULLY_CONNECTED</a>   1</td></tr>
|
||
|
<tr><td colspan="2"><h2><a name="func-members"></a>
|
||
|
Functions</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#a081fa81c441869cae259200c3a98813d">lc_setFrame</a> (unsigned long)</td></tr>
|
||
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">The setFrame function. <a href="#a081fa81c441869cae259200c3a98813d"></a><br/></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#ad134c376119d05b37ed9c2f5c072401c">lc_setMode</a> (int)</td></tr>
|
||
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">The setMode function. <a href="#ad134c376119d05b37ed9c2f5c072401c"></a><br/></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#a1cb20405edba4bb4431f84bcd8f10fe8">lc_saveFrame</a> (unsigned long, int, int)</td></tr>
|
||
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">The saveFrame function. <a href="#a1cb20405edba4bb4431f84bcd8f10fe8"></a><br/></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#a957cc6386f5003a643745976e6645424">lc_init</a> (void)</td></tr>
|
||
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">The init function. <a href="#a957cc6386f5003a643745976e6645424"></a><br/></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#a4f8795ce1824939dc5ae527f835be760">lc_close</a> (void)</td></tr>
|
||
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">The close function. <a href="#a4f8795ce1824939dc5ae527f835be760"></a><br/></td></tr>
|
||
|
<tr><td colspan="2"><h2><a name="var-members"></a>
|
||
|
Variables</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">usb_dev_handle * </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#a6425bf1a1c385443f415abfd8287f1a3">_lc_handle</a> = NULL</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">const unsigned char </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#a27287e09e72aa83387797c8f7934c404">_lc_rawVid</a> [2] = {USB_CFG_VENDOR_ID}</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">const unsigned char </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#af3706eb25df4a97fb3afb5c76b725ac2">_lc_rawPid</a> [2] = {USB_CFG_DEVICE_ID}</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">char </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#ac302050d44ed50afec5d806d0834ff32">_lc_vendor</a> [] = {USB_CFG_VENDOR_NAME, 0}</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">char </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#aa46691773a9b13cbaee644ec4d4a28aa">_lc_product</a> [] = {USB_CFG_DEVICE_NAME, 0}</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">char </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#ac61239c8872d93071e0f9824234b6cd8">_lc_buffer</a> [4]</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#aa24273d8d3e8fd3f3af40fe62bf82439">_lc_vid</a></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="ledcube_8h.html#a90c96f24a9760ef3a0e7e4d718fefe3f">_lc_pid</a></td></tr>
|
||
|
</table>
|
||
|
<hr/><h2>Define Documentation</h2>
|
||
|
<a class="anchor" id="a9346e6751e831ccf0560c7a1152a2fab"></a><!-- doxytag: member="ledcube.h::DEVICE_NOT_FOUND_ERROR" ref="a9346e6751e831ccf0560c7a1152a2fab" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define DEVICE_NOT_FOUND_ERROR   -2</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ac70f88eda20bac5cf379d1512ad5f2ab"></a><!-- doxytag: member="ledcube.h::NOT_CONNECTED_ERROR" ref="ac70f88eda20bac5cf379d1512ad5f2ab" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define NOT_CONNECTED_ERROR   -1</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a685f5d598cb43342b6357ced7e77c380"></a><!-- doxytag: member="ledcube.h::SUCCESSFULLY_CONNECTED" ref="a685f5d598cb43342b6357ced7e77c380" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define SUCCESSFULLY_CONNECTED   1</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/><h2>Function Documentation</h2>
|
||
|
<a class="anchor" id="a4f8795ce1824939dc5ae527f835be760"></a><!-- doxytag: member="ledcube.h::lc_close" ref="a4f8795ce1824939dc5ae527f835be760" args="(void)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int lc_close </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">void </td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>The close function. </p>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>NOT_CONNECTED_ERROR or return state of the usb_close function. </dd></dl>
|
||
|
<div class="fragment"><pre class="fragment">{
|
||
|
<span class="keywordflow">if</span> (<a class="code" href="ledcube_8h.html#a6425bf1a1c385443f415abfd8287f1a3">_lc_handle</a> == NULL)
|
||
|
<span class="keywordflow">return</span> <a class="code" href="ledcube_8h.html#ac70f88eda20bac5cf379d1512ad5f2ab">NOT_CONNECTED_ERROR</a>;
|
||
|
|
||
|
<span class="keywordflow">return</span> usb_close(<a class="code" href="ledcube_8h.html#a6425bf1a1c385443f415abfd8287f1a3">_lc_handle</a>);
|
||
|
|
||
|
}
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a957cc6386f5003a643745976e6645424"></a><!-- doxytag: member="ledcube.h::lc_init" ref="a957cc6386f5003a643745976e6645424" args="(void)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int lc_init </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">void </td>
|
||
|
<td class="paramname"></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>The init function. </p>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>SUCCESSFULLY_CONNECTED or DEVICE_NOT_FOUND_ERROR. </dd></dl>
|
||
|
<div class="fragment"><pre class="fragment">{
|
||
|
|
||
|
usb_init();
|
||
|
|
||
|
<span class="comment">/* compute lc_vid/lc_pid from usbconfig.h so that there is a central source of information */</span>
|
||
|
<a class="code" href="ledcube_8h.html#aa24273d8d3e8fd3f3af40fe62bf82439">_lc_vid</a> = <a class="code" href="ledcube_8h.html#a27287e09e72aa83387797c8f7934c404">_lc_rawVid</a>[1] * 256 + <a class="code" href="ledcube_8h.html#a27287e09e72aa83387797c8f7934c404">_lc_rawVid</a>[0];
|
||
|
<a class="code" href="ledcube_8h.html#a90c96f24a9760ef3a0e7e4d718fefe3f">_lc_pid</a> = <a class="code" href="ledcube_8h.html#af3706eb25df4a97fb3afb5c76b725ac2">_lc_rawPid</a>[1] * 256 + <a class="code" href="ledcube_8h.html#af3706eb25df4a97fb3afb5c76b725ac2">_lc_rawPid</a>[0];
|
||
|
|
||
|
<span class="comment">/* The following function is in opendevice.c: */</span>
|
||
|
<span class="keywordflow">if</span>( <a class="code" href="opendevice_8c.html#acea645564f1dfcd741ff20038d811ac5">usbOpenDevice</a>( &<a class="code" href="ledcube_8h.html#a6425bf1a1c385443f415abfd8287f1a3">_lc_handle</a>, <a class="code" href="ledcube_8h.html#aa24273d8d3e8fd3f3af40fe62bf82439">_lc_vid</a>, <a class="code" href="ledcube_8h.html#ac302050d44ed50afec5d806d0834ff32">_lc_vendor</a>, <a class="code" href="ledcube_8h.html#a90c96f24a9760ef3a0e7e4d718fefe3f">_lc_pid</a>, <a class="code" href="ledcube_8h.html#aa46691773a9b13cbaee644ec4d4a28aa">_lc_product</a>, NULL, NULL, NULL) != 0)
|
||
|
{
|
||
|
fprintf(stderr, <span class="stringliteral">"Could not find USB device \"%s\" with lc_vid=0x%x lc_pid=0x%x\n"</span>, <a class="code" href="ledcube_8h.html#aa46691773a9b13cbaee644ec4d4a28aa">_lc_product</a>, <a class="code" href="ledcube_8h.html#aa24273d8d3e8fd3f3af40fe62bf82439">_lc_vid</a>, <a class="code" href="ledcube_8h.html#a90c96f24a9760ef3a0e7e4d718fefe3f">_lc_pid</a>);
|
||
|
<span class="keywordflow">return</span> <a class="code" href="ledcube_8h.html#a9346e6751e831ccf0560c7a1152a2fab">DEVICE_NOT_FOUND_ERROR</a>;
|
||
|
}
|
||
|
<span class="keywordflow">return</span> <a class="code" href="ledcube_8h.html#a685f5d598cb43342b6357ced7e77c380">SUCCESSFULLY_CONNECTED</a>;
|
||
|
}
|
||
|
</pre></div>
|
||
|
<p><div class="dynheader">
|
||
|
Here is the call graph for this function:</div>
|
||
|
<div class="dyncontent">
|
||
|
<div class="center"><img src="ledcube_8h_a957cc6386f5003a643745976e6645424_cgraph.png" border="0" usemap="#ledcube_8h_a957cc6386f5003a643745976e6645424_cgraph" alt=""/></div>
|
||
|
<map name="ledcube_8h_a957cc6386f5003a643745976e6645424_cgraph" id="ledcube_8h_a957cc6386f5003a643745976e6645424_cgraph">
|
||
|
<area shape="rect" id="node3" href="opendevice_8c.html#acea645564f1dfcd741ff20038d811ac5" title="usbOpenDevice" alt="" coords="109,5,224,35"/><area shape="rect" id="node5" href="opendevice_8c.html#a75b5f0b18368de18125662f87524b5b0" title="usbGetStringAscii" alt="" coords="273,5,399,35"/></map>
|
||
|
</div>
|
||
|
</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a1cb20405edba4bb4431f84bcd8f10fe8"></a><!-- doxytag: member="ledcube.h::lc_saveFrame" ref="a1cb20405edba4bb4431f84bcd8f10fe8" args="(unsigned long, int, int)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int lc_saveFrame </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">unsigned long </td>
|
||
|
<td class="paramname"><em>frame</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"><em>delay</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"><em>index</em> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>The saveFrame function. </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">frame</td><td>The 32bit frame data. Bit 0-8 equals layer one; bit 9 - 17 euqals layer two; bit 18 - 26 equals layer three. The 5 MSB is the lifetime of the current frame in ISR calls (300Hz) multiplied by 8. </td></tr>
|
||
|
<tr><td class="paramname">deay</td><td>The lifetime (onyl 5 bits) of the given frame in ISR calls multiplied by 8. </td></tr>
|
||
|
<tr><td class="paramname">index</td><td>The position in the EEPROM (0 to 31) of the internal animation content. </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>NOT_CONNECTED_ERROR or the return value of the usb_control_msg function. </dd></dl>
|
||
|
<div class="fragment"><pre class="fragment">{
|
||
|
<span class="keywordflow">if</span> (<a class="code" href="ledcube_8h.html#a6425bf1a1c385443f415abfd8287f1a3">_lc_handle</a> == NULL)
|
||
|
<span class="keywordflow">return</span> <a class="code" href="ledcube_8h.html#ac70f88eda20bac5cf379d1512ad5f2ab">NOT_CONNECTED_ERROR</a>;
|
||
|
|
||
|
frame = frame + (delay << 27);
|
||
|
|
||
|
<a class="code" href="clcc_8c.html#ab49cd720216d340f0a8d714c5a0edc0c" title="The setFrame function.">lc_setFrame</a>(frame);
|
||
|
|
||
|
<span class="keywordflow">return</span> usb_control_msg(<a class="code" href="ledcube_8h.html#a6425bf1a1c385443f415abfd8287f1a3">_lc_handle</a>, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, CUSTOM_RQ_EEPROM_STORE_FRAME, 0, index, <a class="code" href="ledcube_8h.html#ac61239c8872d93071e0f9824234b6cd8">_lc_buffer</a>, 0, 300);
|
||
|
}
|
||
|
</pre></div>
|
||
|
<p><div class="dynheader">
|
||
|
Here is the call graph for this function:</div>
|
||
|
<div class="dyncontent">
|
||
|
<div class="center"><img src="ledcube_8h_a1cb20405edba4bb4431f84bcd8f10fe8_cgraph.png" border="0" usemap="#ledcube_8h_a1cb20405edba4bb4431f84bcd8f10fe8_cgraph" alt=""/></div>
|
||
|
<map name="ledcube_8h_a1cb20405edba4bb4431f84bcd8f10fe8_cgraph" id="ledcube_8h_a1cb20405edba4bb4431f84bcd8f10fe8_cgraph">
|
||
|
<area shape="rect" id="node3" href="clcc_8c.html#ab49cd720216d340f0a8d714c5a0edc0c" title="The setFrame function." alt="" coords="159,5,252,35"/></map>
|
||
|
</div>
|
||
|
</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a081fa81c441869cae259200c3a98813d"></a><!-- doxytag: member="ledcube.h::lc_setFrame" ref="a081fa81c441869cae259200c3a98813d" args="(unsigned long)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int lc_setFrame </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">unsigned long </td>
|
||
|
<td class="paramname"><em>frame</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>The setFrame function. </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">frame</td><td>The 32bit frame data. Bit 0-8 equals layer one; bit 9 - 17 euqals layer two; bit 18 - 26 equals layer three. the 5 MSB is the lifetime of the current frame in ISR calls (300Hz). </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>NOT_CONNECTED_ERROR or the return value of the usb_control_msg function. </dd></dl>
|
||
|
<div class="fragment"><pre class="fragment">{
|
||
|
|
||
|
<span class="keywordflow">if</span> (<a class="code" href="ledcube_8h.html#a6425bf1a1c385443f415abfd8287f1a3">_lc_handle</a> == NULL)
|
||
|
<span class="keywordflow">return</span> <a class="code" href="ledcube_8h.html#ac70f88eda20bac5cf379d1512ad5f2ab">NOT_CONNECTED_ERROR</a>;
|
||
|
|
||
|
<span class="keywordtype">int</span> low = frame & 0xffff;
|
||
|
<span class="keywordtype">int</span> high = (frame & 0xffff0000) >> 16;
|
||
|
|
||
|
<span class="keywordtype">int</span> ret = usb_control_msg(<a class="code" href="ledcube_8h.html#a6425bf1a1c385443f415abfd8287f1a3">_lc_handle</a>, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, CUSTOM_RQ_SET_FRAME, low, 0, <a class="code" href="ledcube_8h.html#ac61239c8872d93071e0f9824234b6cd8">_lc_buffer</a>, 0, 300);
|
||
|
ret += usb_control_msg(<a class="code" href="ledcube_8h.html#a6425bf1a1c385443f415abfd8287f1a3">_lc_handle</a>, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, CUSTOM_RQ_SET_FRAME, high, 1, <a class="code" href="ledcube_8h.html#ac61239c8872d93071e0f9824234b6cd8">_lc_buffer</a>, 0, 300);
|
||
|
|
||
|
<span class="keywordflow">return</span> ret;
|
||
|
}
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ad134c376119d05b37ed9c2f5c072401c"></a><!-- doxytag: member="ledcube.h::lc_setMode" ref="ad134c376119d05b37ed9c2f5c072401c" args="(int)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int lc_setMode </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"><em>mode</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>The setMode function. </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">mode</td><td>The firmware mode. MODE_ANIMATION_STOP; MODE_ANIMATION_SINGLE; MODE_ANIMATION_LOOP </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>NOT_CONNECTED_ERROR or the return value of the usb_control_msg function. </dd></dl>
|
||
|
<div class="fragment"><pre class="fragment">{
|
||
|
<span class="keywordflow">if</span> (<a class="code" href="ledcube_8h.html#a6425bf1a1c385443f415abfd8287f1a3">_lc_handle</a> == NULL)
|
||
|
<span class="keywordflow">return</span> <a class="code" href="ledcube_8h.html#ac70f88eda20bac5cf379d1512ad5f2ab">NOT_CONNECTED_ERROR</a>;
|
||
|
|
||
|
<span class="keywordflow">return</span> usb_control_msg(<a class="code" href="ledcube_8h.html#a6425bf1a1c385443f415abfd8287f1a3">_lc_handle</a>, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, CUSTOM_RQ_SET_MODE, mode, 0, <a class="code" href="ledcube_8h.html#ac61239c8872d93071e0f9824234b6cd8">_lc_buffer</a>, 0, 300);
|
||
|
}
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/><h2>Variable Documentation</h2>
|
||
|
<a class="anchor" id="ac61239c8872d93071e0f9824234b6cd8"></a><!-- doxytag: member="ledcube.h::_lc_buffer" ref="ac61239c8872d93071e0f9824234b6cd8" args="[4]" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">char <a class="el" href="ledcube_8h.html#ac61239c8872d93071e0f9824234b6cd8">_lc_buffer</a>[4]</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a6425bf1a1c385443f415abfd8287f1a3"></a><!-- doxytag: member="ledcube.h::_lc_handle" ref="a6425bf1a1c385443f415abfd8287f1a3" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">usb_dev_handle* <a class="el" href="ledcube_8h.html#a6425bf1a1c385443f415abfd8287f1a3">_lc_handle</a> = NULL</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a90c96f24a9760ef3a0e7e4d718fefe3f"></a><!-- doxytag: member="ledcube.h::_lc_pid" ref="a90c96f24a9760ef3a0e7e4d718fefe3f" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int <a class="el" href="ledcube_8h.html#a90c96f24a9760ef3a0e7e4d718fefe3f">_lc_pid</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="aa46691773a9b13cbaee644ec4d4a28aa"></a><!-- doxytag: member="ledcube.h::_lc_product" ref="aa46691773a9b13cbaee644ec4d4a28aa" args="[]" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">char <a class="el" href="ledcube_8h.html#aa46691773a9b13cbaee644ec4d4a28aa">_lc_product</a>[] = {USB_CFG_DEVICE_NAME, 0}</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="af3706eb25df4a97fb3afb5c76b725ac2"></a><!-- doxytag: member="ledcube.h::_lc_rawPid" ref="af3706eb25df4a97fb3afb5c76b725ac2" args="[2]" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">const unsigned char <a class="el" href="ledcube_8h.html#af3706eb25df4a97fb3afb5c76b725ac2">_lc_rawPid</a>[2] = {USB_CFG_DEVICE_ID}</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a27287e09e72aa83387797c8f7934c404"></a><!-- doxytag: member="ledcube.h::_lc_rawVid" ref="a27287e09e72aa83387797c8f7934c404" args="[2]" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">const unsigned char <a class="el" href="ledcube_8h.html#a27287e09e72aa83387797c8f7934c404">_lc_rawVid</a>[2] = {USB_CFG_VENDOR_ID}</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ac302050d44ed50afec5d806d0834ff32"></a><!-- doxytag: member="ledcube.h::_lc_vendor" ref="ac302050d44ed50afec5d806d0834ff32" args="[]" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">char <a class="el" href="ledcube_8h.html#ac302050d44ed50afec5d806d0834ff32">_lc_vendor</a>[] = {USB_CFG_VENDOR_NAME, 0}</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="aa24273d8d3e8fd3f3af40fe62bf82439"></a><!-- doxytag: member="ledcube.h::_lc_vid" ref="aa24273d8d3e8fd3f3af40fe62bf82439" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int <a class="el" href="ledcube_8h.html#aa24273d8d3e8fd3f3af40fe62bf82439">_lc_vid</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- window showing the filter options -->
|
||
|
<div id="MSearchSelectWindow"
|
||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Defines</a></div>
|
||
|
|
||
|
<!-- iframe showing the search results (closed by default) -->
|
||
|
<div id="MSearchResultsWindow">
|
||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||
|
name="MSearchResults" id="MSearchResults">
|
||
|
</iframe>
|
||
|
</div>
|
||
|
|
||
|
<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 25 2011 13:37:31 for CTHN.de - LEDCube - commandline client by 
|
||
|
<a href="http://www.doxygen.org/index.html">
|
||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
|
||
|
</body>
|
||
|
</html>
|