|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。
( F" }% }4 J0 o: a7 S2 s, ]$ n, g$ j *** DaVinci Core Type *** | |
, S) t1 G3 u! d* I7 `9 D | | [ ] DaVinci 644x based system | |
& O. E9 ~3 I7 \( ?* ^ F | | [ ] DaVinci 355 based system | |
! E* n1 E; ? H, X2 D | | [ ] DaVinci 646x based system | |
; O+ W4 K9 P0 s& j$ O | | [ ] DA830/OMAP-L137/AM17x based system | |
9 s6 e2 p5 z8 Z$ t | | [*] DA850/OMAP-L138/AM18x based system | |
. v8 Z( E D! a, a | | [ ] Enable UART1 flow control | |( Y4 r+ B' A* Y& ^" ]
| | [ ] Enable UART0 RS485 funcation | |
6 ~ y* C* T5 a7 K- ] | | [*] Enable UART1 RS485 funcation m* W( S" D7 i
$ O; g* s$ k M: D想了解详细的功能实现,也可以查看8250.c文件里面的;( F1 ]( k9 k+ P1 l; i8 h, k
void serial8250_tx_chars(struct uart_8250_port *up)
5 ~% J- ~# {! i& k# C% ~8 _ return;
0 V0 C( P% [/ R; r }
4 W4 k7 P! i% S! u. s/ Y& r7 g/ w$ Z7 I& M3 G2 X- u
+#if 1
# t; F- A0 g; o" e# \. \+ /* The funcation with RS485 flow control */
+ K; U0 d N' P7 ]# ^+ n+ if (up->port.private_data) {$ D/ |8 s! w& K5 T8 ~
+ struct serial8250_flow_ctrl *flow_ctrl_p;
' M1 y( X+ D) L+ flow_ctrl_p = up->port.private_data;
: e' J9 L( X( ]+
) w# Q j8 J: P! T/ H0 G- p+ if (flow_ctrl_p->gpio) {
1 [1 B2 a! J. O# c F5 M) ~7 f+ gpio_set_value(flow_ctrl_p->gpio, 1);1 G/ j% S8 e& q
+ ndelay(50); /* Propagation delay >= 50ns */& C. C/ S3 m' j+ p# {3 x1 Q
+ }' {, `% a% e" X4 d
+ }/ b( ^8 j1 M- n0 U' {
+#endif
5 D5 h( U+ b; b% s+ _+ X% K' P希望对您有帮助。2 z! h+ N9 P% L0 w( `
|
|