|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。+ [) \" N2 [9 j/ F
*** DaVinci Core Type *** | |' K7 y7 G2 i% L$ v
| | [ ] DaVinci 644x based system | |0 B/ l' F# p& h! ]4 K
| | [ ] DaVinci 355 based system | |+ O+ y7 V0 v, Z( N5 S
| | [ ] DaVinci 646x based system | |
6 Q, m' W) U; y- ]+ W | | [ ] DA830/OMAP-L137/AM17x based system | |/ t1 V! C' z0 S9 C
| | [*] DA850/OMAP-L138/AM18x based system | |2 s5 F8 h1 l1 L% [6 g
| | [ ] Enable UART1 flow control | |
4 \1 t; k# o R5 O, |7 @ | | [ ] Enable UART0 RS485 funcation | |4 j( E! `$ n9 S- w8 [
| | [*] Enable UART1 RS485 funcation
6 ^- A4 X5 u" U7 x0 y, j" q& ~- C$ K" ?5 x, L J
想了解详细的功能实现,也可以查看8250.c文件里面的;
9 F( p5 h) _; p/ E7 nvoid serial8250_tx_chars(struct uart_8250_port *up)
& q h. W; f# P% k! X8 ] return;1 M. S/ I+ _) F9 ^" S7 z5 j6 V/ p
}7 f0 h& Y1 A4 K/ y1 q- r# V
6 K3 A" F4 N7 T: a; w+#if 1 `& K7 o* p% D
+ /* The funcation with RS485 flow control */2 A8 s% g; Y# @% n+ N3 M3 z
+ if (up->port.private_data) {- [" `! q5 y& `9 }7 [; h# V
+ struct serial8250_flow_ctrl *flow_ctrl_p;
- I, e: c2 p# T1 t7 r X+ flow_ctrl_p = up->port.private_data;
0 A7 ? D8 u+ H# w. ^0 ?2 a/ f9 m, R+$ Q- _0 g5 d7 `% \! }- W s
+ if (flow_ctrl_p->gpio) {
' o: d( _, i, { T: T+ gpio_set_value(flow_ctrl_p->gpio, 1);/ Z! G. [" n! B/ _' ]( v
+ ndelay(50); /* Propagation delay >= 50ns */
$ v# T3 p! N# `# T- Q9 s. e5 S: r% V* N+ }$ y5 s% J1 z/ Q$ i% k$ |- W
+ }0 y% d1 L5 V( v/ I8 @
+#endif
2 b Z3 L+ R3 A# m希望对您有帮助。( q5 ~8 L* e1 n1 Q) @
|
|