|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。8 X/ c1 V' z% N8 g% o/ n/ y% U
*** DaVinci Core Type *** | |
2 B. i$ C% J0 v | | [ ] DaVinci 644x based system | |7 M) c2 s6 ?/ E4 C
| | [ ] DaVinci 355 based system | |, [$ V, e% I9 X# ]* p3 n
| | [ ] DaVinci 646x based system | |( k6 p+ [/ `- W7 w6 \) R5 J7 W
| | [ ] DA830/OMAP-L137/AM17x based system | |- P: S9 x2 s- _
| | [*] DA850/OMAP-L138/AM18x based system | |; Y5 g2 x- U( e& h
| | [ ] Enable UART1 flow control | |
+ q. n) f7 c) Z; L | | [ ] Enable UART0 RS485 funcation | |
+ b, \5 v- p6 D) y0 R( E | | [*] Enable UART1 RS485 funcation
* ^. o% s8 D _8 b! \5 y5 N, b9 i* @% r- O6 @( [# p% A( z# v
想了解详细的功能实现,也可以查看8250.c文件里面的;4 @: A8 o! B5 z' Y3 c
void serial8250_tx_chars(struct uart_8250_port *up)
' B! w' M0 |; F5 b! S return; t8 u6 ]- J8 W& w" r
}
# ]7 {' U' B7 n9 E3 p7 d8 R2 V* i4 Z+ t4 \9 [
+#if 1
# J% h2 B0 h8 ?# @+ M# m+ /* The funcation with RS485 flow control */
1 o% b, `. _8 |# c0 D0 Q! c4 l2 F+ if (up->port.private_data) {
+ i; e. b1 ^# O4 n+ struct serial8250_flow_ctrl *flow_ctrl_p;4 f R5 x- [4 o+ S
+ flow_ctrl_p = up->port.private_data;7 [$ \. L( p0 p/ a2 n3 ^4 E; Q
+
& Q7 H% g1 M0 b( V8 L) v+ if (flow_ctrl_p->gpio) {; @5 g& ~" l# f; Z9 c% ?# t4 U9 `
+ gpio_set_value(flow_ctrl_p->gpio, 1);3 q4 I6 d5 f" {( x0 a9 z
+ ndelay(50); /* Propagation delay >= 50ns */6 A7 `$ ]2 d1 |* {
+ }( Y4 S* z9 z3 \ ]( u3 k
+ }' q4 d. M0 ~( d9 S( n
+#endif
0 L6 D$ I( e$ y3 F( @希望对您有帮助。
' r+ r( @% O/ D( n( m) I. J( A |
|