<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.viewtool.com/wiki/index.php?action=history&amp;feed=atom&amp;title=%E5%87%BD%E6%95%B0%EF%BC%9AUART_InitDevice</id>
		<title>函数：UART InitDevice - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.viewtool.com/wiki/index.php?action=history&amp;feed=atom&amp;title=%E5%87%BD%E6%95%B0%EF%BC%9AUART_InitDevice"/>
		<link rel="alternate" type="text/html" href="http://www.viewtool.com/wiki/index.php?title=%E5%87%BD%E6%95%B0%EF%BC%9AUART_InitDevice&amp;action=history"/>
		<updated>2026-05-05T14:58:43Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.viewtool.com/wiki/index.php?title=%E5%87%BD%E6%95%B0%EF%BC%9AUART_InitDevice&amp;diff=273960&amp;oldid=prev</id>
		<title>Xuzuolan: Created page with &quot;初始化配置UART模块。  ==== 原型 ==== int32_t WINAPI UART_InitDevice(int32_t DevIndex,int32_t UARTIndex, PUART_INIT_CONFIG pInitConfig); ==== 参数 ==== '''DevIndex'...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.viewtool.com/wiki/index.php?title=%E5%87%BD%E6%95%B0%EF%BC%9AUART_InitDevice&amp;diff=273960&amp;oldid=prev"/>
				<updated>2021-05-12T06:32:50Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;初始化配置UART模块。  ==== 原型 ==== int32_t WINAPI UART_InitDevice(int32_t DevIndex,int32_t UARTIndex, PUART_INIT_CONFIG pInitConfig); ==== 参数 ==== &amp;#039;&amp;#039;&amp;#039;DevIndex&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;初始化配置UART模块。&lt;br /&gt;
&lt;br /&gt;
==== 原型 ====&lt;br /&gt;
int32_t WINAPI UART_InitDevice(int32_t DevIndex,int32_t UARTIndex, PUART_INIT_CONFIG pInitConfig);&lt;br /&gt;
==== 参数 ====&lt;br /&gt;
'''DevIndex''': 设备索引号，若当前只有一个设备与电脑连接则索引号为0，若有多个设备与电脑连接则根据实际需要打开的设备设置对应的索引号。 &amp;lt;br&amp;gt;&lt;br /&gt;
'''NeedInit''': 是否需要进行驱动初始化，第一次调用该函数时需要设置为 1，以后再次调用的时候可设置为 0. &amp;lt;br&amp;gt;&lt;br /&gt;
'''UARTIndex''':UART通道索引号，取值0或者1。 &amp;lt;br&amp;gt;&lt;br /&gt;
'''pInitConfig''': 指向UART_INIT_CONFIG结构体的指针，该结构体变量主要用于配置UART相关参数。 &amp;lt;br&amp;gt;&lt;br /&gt;
==== 返回值 ====&lt;br /&gt;
程序执行状态，0代表执行相应功能成功，其他返回值含义请参考错误码定义表。&lt;br /&gt;
==== 示例 ====&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;ControUART.h&amp;quot;&lt;br /&gt;
 int ret;&lt;br /&gt;
 UART_INIT_CONFIG InitConfig;&lt;br /&gt;
 InitConfig.BaudRate = 115200;&lt;br /&gt;
 InitConfig.Parity = 0;&lt;br /&gt;
 InitConfig.RS485Mode = 485;&lt;br /&gt;
 InitConfig.StopBits = 0;&lt;br /&gt;
 InitConfig.WordLength = 8;&lt;br /&gt;
 ret = UART_InitDevice(0,0,&amp;amp;InitConfig);&lt;br /&gt;
 if(ret != ERR_SUCCESS){&lt;br /&gt;
 printf(&amp;quot;Initialize device error!\n&amp;quot;);&lt;br /&gt;
 return;&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Xuzuolan</name></author>	</entry>

	</feed>