热度 17
2016-4-15 16:29
1028 次阅读|
0 个评论
UART串口作为最为常用的工业设备接口之一被广泛且大量的应用,本文就基于Toradex ARM平台设备为例介绍WinCE下UART配置。 我们采用Colibri ARM核心板产品搭配 Colibri开发板 来进行测试,OS为Toradex官方发布的最新版WinCE,其中Colibri系列默认定义了三个串口,UART A, UART B和UART C,其中UART A用作调试串口使用,下面就分别针对不同SoC产品进行说明。 1). 基于NXP i.MX6Solo/DualLite 的 Colibri i.MX6 产品 系统默认定义COM 1 – UART A (调试串口,全功能);COM 2 – UART B (支持Flow control);COM 3 – UART C;另外还支持额外的两个串口UART D和UART E,默认没有使能;所有串口默认均为DTE模式。 ./ 使能UART D方法,请在注册表中添加下面内容并保存 ----------------------------- "Order"=dword:00000002 "IoLen"=dword:000000d4 "IoBase"=dword:021f0000 "Index"=dword:00000004 "DeviceArrayIndex"=dword:00000003 "Prefix"="COM" "Dll"="csp_serial.dll" "DevConfig"=hex:10,00,00,00,05,00,00,00,10,01,00,00,00,4B,00,00,00,00,08,00,00,00,00,00,00 "DeviceType"=dword:00000000 "Tsp"="Unimodem.dll" "FriendlyName"="COM4 UNIMODEM" "colibripin_165"="altfn=3" "colibripin_167"="altfn=3" ----------------------------- ./ 使能UART E方法,请在注册表中添加下面内容并保存 ----------------------------- "Order"=dword:00000002 "IoLen"=dword:000000d4 "IoBase"=dword:021f4000 "Index"=dword:00000005 "DeviceArrayIndex"=dword:00000004 "Prefix"="COM" "Dll"="csp_serial.dll" "DevConfig"=hex:10,00,00,00,05,00,00,00,10,01,00,00,00,4B,00,00,00,00,08,00,00,00,00,00,00 "DeviceType"=dword:00000000 "Tsp"="Unimodem.dll" "FriendlyName"="COM5 UNIMODEM" "colibripin_169"="altfn=3" "colibripin_171"="altfn=3" ----------------------------- 2). 基于NXP Vybrid 的 Colibri VF50/VF61 产品 系统默认定义COM 1 – UART A (调试串口,全功能控制引脚需使用GPIO);COM 2 – UART B (支持Flow control);COM 3 – UART C;另外还支持额外的两个串口UART D和UART E,默认没有使能。 ./ 使能UART D方法,请在注册表中添加下面内容并保存 ----------------------------- "DeviceArrayIndex"=dword:00000003 "Index"=dword:00000004 "Prefix"="COM" "Dll"="vybrid_serial.dll" "Order"=dword:00000001 "TXPIN"=dword:00000017 "TXAF"=dword:00000006 "RXPIN"=dword:0000001f "RXAF"=dword:00000006 ----------------------------- ./ 使能UART E方法,由于管脚和Colibir默认定义的SDHC接口冲突,因此需先关闭SDHC功能,请在注册表中修改下面内容并保存 ----------------------------- "Dll"="_esdhc.dll" "DeviceArrayIndex"=dword:00000004 "Index"=dword:00000005 "Prefix"="COM" "Dll"="vybrid_serial.dll" "Order"=dword:00000001 "TXPIN"=dword:00000033 "TXAF"=dword:00000004 "RXPIN"=dword:00000035 "RXAF"=dword:00000004 ----------------------------- 3). 基于nVidia Tegra 的 Colibri T20/T30 产品 系统默认定义COM 1 – UART A (UART 1,调试串口,全功能串口);COM 2 – UART B (UART 4, 支持Flow control);COM 3 – IrDA (WinCE6) 或UART C (WEC7)(UART2);另外还支持额外的两个串口UART 3和UART 5,默认没有使能。 ./ WinCE6下COM 3 设置为普通串口方法,注册表如下修改 ----------------------------- " IrConnected"=dword:00000000 " ImagePath "=" _irsir.dll " ----------------------------- ./ UART3 Pin脚定义 SODIMM Pin 115 (GMI_A2) – UART3 TxD SODIMM Pin 117(GMI_A3) – UART3 RxD ./ 使能UART 3方法,请在注册表中添加下面内容并保存 ----------------------------- "DeviceArrayIndex"=dword:00000083 "Prefix"="COM" "Dll"="libnvuart.dll" "Order"=dword:00000004 "Index"=dword:00000004 "IClass"=hex(7):7b,00,41,00,33,00,32,00,39,00,34,00,32,00,42,00,37,00,2d,00,39,00,32,00,30,\ 00,43,00,2d,00,34,00,38,00,36,00,62,00,2d,00,42,00,30,00,45,00,36,00,2d,00,\ 39,00,32,00,41,00,37,00,30,00,32,00,41,00,39,00,39,00,42,00,33,00,35,00,7d,\ 00,00,00,00,00 "Tsp"="Unimodem.dll" "DeviceType"=dword:00000000 "FriendlyName"="Serial on COM4:" "DevConfig"=hex:10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00 ----------------------------- ./ UART5 Pin脚定义 SODIMM Pin 192 – UART5 TxD SODIMM Pin 49 – UART5 RxD ./ 使能UART 5方法,由于管脚和Colibir默认定义的SDIO接口冲突,因此需先关闭SDIO功能,请在注册表中修改下面内容并保存 ----------------------------- "Dll"="_libnvsdio.dll" "DeviceArrayIndex"=dword:00000084 "Prefix"="COM" "Dll"="libnvuart.dll" "Order"=dword:00000004 "Index"=dword:00000005 "IClass"=hex(7):7b,00,41,00,33,00,32,00,39,00,34,00,32,00,42,00,37,00,2d,00,39,00,32,00,30,\ 00,43,00,2d,00,34,00,38,00,36,00,62,00,2d,00,42,00,30,00,45,00,36,00,2d,00,\ 39,00,32,00,41,00,37,00,30,00,32,00,41,00,39,00,39,00,42,00,33,00,35,00,7d,\ 00,00,00,00,00 "Tsp"="Unimodem.dll" "DeviceType"=dword:00000000 "FriendlyName"="Serial on COM5:" "DevConfig"=hex:10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00 ----------------------------- 4). 关于UART 更详细的说明请见 这里 ,另外如何调用Lib 库来访问UART 请见 这里 。