📄 group__xg_c_g_i.html
字号:
</tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>CGI callback function to display the status of the CPU ports. <p>Creates HTML code to show the status of CPU ports B, D, E and F. The page will be automatically refreshed every 5 seconds.<p><div align="center"><img src="sport.gif" alt="sport.gif"></div><p>This function is called by the HTTP module when a browser requests a CGI function, for which this routine has been registered via NutRegisterCgi().<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>stream</em> </td><td>Stream device of the HTTP connection. </td></tr> <tr><td valign="top"></td><td valign="top"><em>req</em> </td><td>Pointer to the CGI REQUEST structure. Detailed information is available in the Nut/OS API documentation.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>0 on success or -1 in case of any failure. </dd></dl><p>Definition at line <a class="el" href="cgi_8c-source.html#l00400">400</a> of file <a class="el" href="cgi_8c-source.html">cgi.c</a>.<p>References <a class="el" href="cgi_8c-source.html#l00093">HtmlLedRow()</a>, and <a class="el" href="webport_8h-source.html#l00066">PORT_STATUS_CGI</a>.<p>Referenced by <a class="el" href="webport_8c-source.html#l00260">main()</a>. </td> </tr></table><a class="anchor" name="ga5" doxytag="cgi.c::HtmlCheckboxRow"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">static void HtmlCheckboxRow </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">FILE * </td> <td class="mdname" nowrap> <em>stream</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_char </td> <td class="mdname" nowrap> <em>num</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_char </td> <td class="mdname" nowrap> <em>desc</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_char * </td> <td class="mdname" nowrap> <em>name</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_long </td> <td class="mdname" nowrap> <em>check</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_long </td> <td class="mdname" nowrap> <em>enable</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"><code> [static]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Print HTML code for a row of checkboxes. <p>The resulting HTML code will present a row of checkboxes.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>stream</em> </td><td>HTML code is printed to this stream device. </td></tr> <tr><td valign="top"></td><td valign="top"><em>num</em> </td><td>The number of checkboxes to print. </td></tr> <tr><td valign="top"></td><td valign="top"><em>desc</em> </td><td>If not equal zero, bits are processed in descending order. </td></tr> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>Identifier of the checkboxes. </td></tr> <tr><td valign="top"></td><td valign="top"><em>check</em> </td><td>The checkbox will be checked if the corresponding bit is set. </td></tr> <tr><td valign="top"></td><td valign="top"><em>enable</em> </td><td>The checkbox will be created only, ff the corresponding bit in this bitmask is set. </td></tr> </table></dl><p>Definition at line <a class="el" href="cgi_8c-source.html#l00140">140</a> of file <a class="el" href="cgi_8c-source.html">cgi.c</a>.<p>Referenced by <a class="el" href="cgi_8c-source.html#l00610">CharonLedControl()</a>, <a class="el" href="cgi_8c-source.html#l00195">HtmlInOutPortRow()</a>, and <a class="el" href="cgi_8c-source.html#l00470">SpiRelayControl()</a>. </td> </tr></table><a class="anchor" name="ga7" doxytag="cgi.c::HtmlInOutPortRow"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">static void HtmlInOutPortRow </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">FILE * </td> <td class="mdname" nowrap> <em>stream</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>char </td> <td class="mdname" nowrap> <em>name</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_char </td> <td class="mdname" nowrap> <em>pin</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_char </td> <td class="mdname" nowrap> <em>port</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_char </td> <td class="mdname" nowrap> <em>ddr</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_char </td> <td class="mdname" nowrap> <em>enable</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"><code> [static]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Print HTML code to display a single I/O port. <p>The resulting HTML code will present a row of LEDs and two rows of checkboxes. While the LEDs show the current port status, the checkboxes may be used to modify the port output and the data direction register.<p>See <a class="el" href="group__xg_c_g_i.html#ga4">HtmlLedRow()</a> for further details about how LEDs are displayed. The checkboxes are created by calling <a class="el" href="group__xg_c_g_i.html#ga5">HtmlCheckboxRow()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>stream</em> </td><td>HTML code is printed to this stream device. </td></tr> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>Port identifier, typically 'A' for Port A, 'B' for port B etc. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pin</em> </td><td>Contents of the PIN register. </td></tr> <tr><td valign="top"></td><td valign="top"><em>port</em> </td><td>Contents of the PORT register. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ddr</em> </td><td>Contents of the data direction register. </td></tr> <tr><td valign="top"></td><td valign="top"><em>enable</em> </td><td>If a bit is not set in this bit mask, then the corresponding checkboxes are not created and the port bits and data direction can't be modified. </td></tr> </table></dl><p>Definition at line <a class="el" href="cgi_8c-source.html#l00195">195</a> of file <a class="el" href="cgi_8c-source.html">cgi.c</a>.<p>References <a class="el" href="cgi_8c-source.html#l00140">HtmlCheckboxRow()</a>, and <a class="el" href="cgi_8c-source.html#l00093">HtmlLedRow()</a>.<p>Referenced by <a class="el" href="cgi_8c-source.html#l00330">CpuPortControl()</a>. </td> </tr></table><a class="anchor" name="ga4" doxytag="cgi.c::HtmlLedRow"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">static void HtmlLedRow </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">FILE * </td> <td class="mdname" nowrap> <em>stream</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_char </td> <td class="mdname" nowrap> <em>num</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_char </td> <td class="mdname" nowrap> <em>desc</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_long </td> <td class="mdname" nowrap> <em>ival</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_long </td> <td class="mdname" nowrap> <em>oval</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>u_long </td> <td class="mdname" nowrap> <em>dir</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"><code> [static]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Print HTML code for a row of LEDs. <p>The resulting HTML code will present a row of LEDs. The color and the lit state of each LED is determined by three bit values. The required images are expected in the URL root of the urom flash filesystem:<p><ul><li>r0.gif Red LED not lit. Will be displayed if the corresponding bit in the direction mask is set and the input and output bits are both not set.</li><li>r1.gif Red LED lit. Will be displayed if the corresponding bit in the direction mask is set and the input and output bits are both set.</li><li>g0.gif Green LED not lit. Will be displayed if the corresponding bit in the direction mask and the input value are both not set.</li><li>g1.gif Green LED lit. Will be displayed if the corresponding bit in the direction mask is not set and the input bit is set.</li><li>y0.gif Yellow LED not lit. Will be displayed if the corresponding bit in the direction mask is set, the output bit is set but the input bit is not set.</li><li>y1.gif Yellow LED lit. Will be displayed if the corresponding bit in the direction mask is set, the output bit is not set but the input bit is set.</li></ul><p>All LED images must be of the same size, 28 x 28 pixels.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>stream</em> </td><td>HTML code is printed to this stream device. </td></tr> <tr><td valign="top"></td><td valign="top"><em>num</em> </td><td>The number of LEDs to print. </td></tr> <tr><td valign="top"></td><td valign="top"><em>desc</em> </td><td>If not equal zero, bits are processed in descending order. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ival</em> </td><td>Input bit values. </td></tr> <tr><td valign="top"></td><td valign="top"><em>oval</em> </td><td>Output bit values. </td></tr> <tr><td valign="top"></td><td valign="top"><em>dir</em> </td><td>Data direction mask. Any bit set to one represents an output. </td></tr> </table></dl><p>Definition at line <a class="el" href="cgi_8c-source.html#l00093">93</a> of file <a class="el" href="cgi_8c-source.html">cgi.c</a>.<p>Referenced by <a class="el" href="cgi_8c-source.html#l00610">CharonLedControl()</a>, <a class="el" href="cgi_8c-source.html#l00689">CharonSwitchStatus()</a>, <a class="el" href="cgi_8c-source.html#l00330">CpuPortControl()</a>, <a class="el" href="cgi_8c-source.html#l00400">CpuPortStatus()</a>, <a class="el" href="cgi_8c-source.html#l00195">HtmlInOutPortRow()</a>, <a class="el" href="cgi_8c-source.html#l00547">SpiOptoStatus()</a>, and <a class="el" href="cgi_8c-source.html#l00470">SpiRelayControl()</a>. </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -