|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。$ i! b* w# e! |& S7 t
*** DaVinci Core Type *** | |4 o8 D( N2 l* s. J& S8 n1 ^! Z9 I
| | [ ] DaVinci 644x based system | |
. N! l/ a4 C0 j4 _3 G- A, Z7 u | | [ ] DaVinci 355 based system | |
; H+ K3 v- ^9 p7 t) y! C; m) R& x | | [ ] DaVinci 646x based system | |# U+ ~: K, u% L8 c
| | [ ] DA830/OMAP-L137/AM17x based system | |' i" l7 ~6 g; ?1 }
| | [*] DA850/OMAP-L138/AM18x based system | |
) w0 X0 v* z ?1 t5 I# F" @ | | [ ] Enable UART1 flow control | |7 K" H2 V' q3 V7 q z, ?
| | [ ] Enable UART0 RS485 funcation | |
+ u" g; z% g" Y' b | | [*] Enable UART1 RS485 funcation
) @8 r6 {( M( `3 i8 w
+ Y+ A2 o4 O4 I C3 K$ U b想了解详细的功能实现,也可以查看8250.c文件里面的;% G% ?9 f _& Z0 ^ v
void serial8250_tx_chars(struct uart_8250_port *up)
/ K; ^/ U: M( y! Y9 U return;
( W3 e! U6 F9 a* k$ B% q [( Q( A# V }
; S' Q9 b% e9 l1 d( T- F" W, `$ i+ `7 g. m5 w0 Y& {
+#if 1* W8 e% k& V' I* o0 i1 r
+ /* The funcation with RS485 flow control */$ j' |7 u2 j h( i% Z# p1 l* g
+ if (up->port.private_data) {
* R+ `. s* b3 d- [$ ^+ e4 b1 D) u+ struct serial8250_flow_ctrl *flow_ctrl_p;- H4 j% g- \& O) {/ p
+ flow_ctrl_p = up->port.private_data;6 K3 J1 }8 e& C% C, l) C% C
+6 t6 ^1 Z) y5 P; `/ Q2 t# E
+ if (flow_ctrl_p->gpio) {
6 m$ R' R& Y! v! c' u6 j9 M+ gpio_set_value(flow_ctrl_p->gpio, 1);. I3 v) G; ^9 I* p4 k; _: C& @6 X
+ ndelay(50); /* Propagation delay >= 50ns */1 _& N0 u9 O- P+ j
+ }. H8 T4 m% x( l! q) R
+ }
/ l2 B) I/ m3 t5 t+ r0 e7 j* ~- O" m+#endif
, `* d; c- J7 V2 ]6 @- i希望对您有帮助。8 N. e& r4 E# t M1 _
|
|