📄 io-serial-driver-details.html
字号:
CLASS="LITERAL">CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING</TT>to be enabled, and the specific device to be set to non-blockingmode for reads (see <TTCLASS="FUNCTION">cyg_io_set_config()</TT>).</P><P>In blocking mode, the call will not return until the requestedamount of data has been read.</P><P>In non-blocking mode, data waiting in the device buffer is copied to<TTCLASS="PARAMETER"><I>buf</I></TT>, and the call returns immediately. If therewas enough data in the buffer to fulfill the request,<TTCLASS="LITERAL">ENOERR</TT> is returned. If only part of the requestcould be fulfilled, <TTCLASS="LITERAL">-EAGAIN</TT> is returned and thecaller must try again. On return, <TTCLASS="PARAMETER"><I>*len</I></TT> containsthe number of characters actually received.</P><P>The call can also return <TTCLASS="LITERAL">-EINTR</TT> if interrupted viathe <TTCLASS="FUNCTION">cyg_io_get_config()</TT>/<TTCLASS="LITERAL">ABORT</TT>key.</P></DIV><DIVCLASS="SECTION"><H3CLASS="SECTION"><ANAME="IO-SERIAL-CYG-GET-CONFIG">cyg_io_get_config</H3><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">cyg_io_get_config(handle, key, buf, len)</PRE></TD></TR></TABLE><P>This function returns current [runtime] informationabout the device and/or driver. </P><P></P><DIVCLASS="VARIABLELIST"><DL><DT><TTCLASS="LITERAL">CYG_IO_GET_CONFIG_SERIAL_INFO</TT></DT><DD><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Buf type:</DT><DD><P>cyg_serial_info_t</P></DD><DT>Function:</DT><DD><P> This function retrieves the current state of the driver and hardware. This information contains fields for hardware baud rate, number of stop bits, and parity mode. It also includes a set of flags that control the port, such as hardware flow control. </P></DD></DL></DIV></DD><DT><TTCLASS="LITERAL">CYG_IO_GET_CONFIG_SERIAL_BUFFER_INFO</TT></DT><DD><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Buf type:</DT><DD><P>cyg_serial_buf_info_t</P></DD><DT>Function:</DT><DD><P> This function retrieves the current state of the software buffers in the serial drivers. For both receive and transmit buffers it returns the total buffer size and the current number of bytes occupied in the buffer. It does not take into account any buffering such as FIFOs or holding registers that the serial device itself may have. </P></DD></DL></DIV></DD><DT><TTCLASS="LITERAL">CYG_IO_GET_CONFIG_SERIAL_OUTPUT_DRAIN</TT></DT><DD><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Buf type:</DT><DD><P>void *</P></DD><DT>Function:</DT><DD><P> This function waits for any buffered output to complete. This function only completes when there is no more data remaining to be sent to the device. </P></DD></DL></DIV></DD><DT><TTCLASS="LITERAL">CYG_IO_GET_CONFIG_SERIAL_OUTPUT_FLUSH</TT></DT><DD><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Buf type:</DT><DD><P>void *</P></DD><DT>Function:</DT><DD><P> This function discards any buffered output for the device. </P></DD></DL></DIV></DD><DT><TTCLASS="LITERAL">CYG_IO_GET_CONFIG_SERIAL_INPUT_DRAIN</TT></DT><DD><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Buf type:</DT><DD><P>void *</P></DD><DT>Function:</DT><DD><P>This function discards any buffered input for the device.</P></DD></DL></DIV></DD><DT><TTCLASS="LITERAL">CYG_IO_GET_CONFIG_SERIAL_ABORT</TT></DT><DD><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Buf type:</DT><DD><P> void*</P></DD><DT>Function:</DT><DD><P>This function will cause any pending read or write calls on this device to return with <TTCLASS="LITERAL">-EABORT</TT>.</P></DD></DL></DIV></DD><DT><TTCLASS="LITERAL">CYG_IO_GET_CONFIG_SERIAL_READ_BLOCKING</TT></DT><DD><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Buf type:</DT><DD><P> cyg_uint32 (values 0 or 1)</P></DD><DT>Function:</DT><DD><P>This function will read back the blocking-mode setting for read calls on this device. This call is only available if the configuration option <TTCLASS="LITERAL">CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING</TT> is enabled.</P></DD></DL></DIV></DD><DT><TTCLASS="LITERAL">CYG_IO_GET_CONFIG_SERIAL_WRITE_BLOCKING</TT></DT><DD><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Buf type:</DT><DD><P> cyg_uint32 (values 0 or 1)</P></DD><DT>Function:</DT><DD><P> This function will read back the blocking-mode setting for write calls on this device. This call is only available if the configuration option <TTCLASS="LITERAL">CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING</TT> is enabled.</P></DD></DL></DIV></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H3CLASS="SECTION"><ANAME="IO-SERIAL-CYG-SET-CONFIG">cyg_io_set_config</H3><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">cyg_io_set_config(handle, key, buf,len)</PRE></TD></TR></TABLE><P>This function is used to update or change runtime configurationof a port. </P><P></P><DIVCLASS="VARIABLELIST"><DL><DT><TTCLASS="LITERAL">CYG_IO_SET_CONFIG_SERIAL_INFO</TT></DT><DD><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Buf type:</DT><DD><P>cyg_serial_info_t</P></DD><DT>Function:</DT><DD><P>This function updates the information for the driver and hardware. The information contains fields for hardware baud rate, number of stop bits, and parity mode. It also includes a set of flags that control the port, such as hardware flow control. </P></DD></DL></DIV></DD><DT><TTCLASS="LITERAL">CYG_IO_SET_CONFIG_SERIAL_READ_BLOCKING</TT></DT><DD><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Buf type:</DT><DD><P> cyg_uint32 (values 0 or 1)</P></DD><DT>Function:</DT><DD><P>This function will set the blocking-mode for read calls on this device. This call is only available if the configuration option <TTCLASS="LITERAL">CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING</TT> is enabled. </P></DD></DL></DIV></DD><DT><TTCLASS="LITERAL">CYG_IO_SET_CONFIG_SERIAL_WRITE_BLOCKING</TT></DT><DD><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Buf type:</DT><DD><P>cyg_uint32 (values 0 or 1)</P></DD><DT>Function:</DT><DD><P>This function will set the blocking-mode for write calls on this device. This call is only available if the configuration option <TTCLASS="LITERAL">CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING</TT> is enabled. </P></DD></DL></DIV></DD></DL></DIV></DIV></DIV></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="io-user-api.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="io-tty-driver.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">User API</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="io.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">TTY driver</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -