|
|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。 R7 D( c5 | i
*** DaVinci Core Type *** | |0 r" s. ^. e( ]3 _/ l6 J
| | [ ] DaVinci 644x based system | |( ]4 K* e# i7 r1 i
| | [ ] DaVinci 355 based system | |) y* j! T/ q0 R9 J1 F ]- }
| | [ ] DaVinci 646x based system | |
y1 |& v4 J( T; u9 U! I | | [ ] DA830/OMAP-L137/AM17x based system | |5 s0 t2 Q# E3 h- Z" D5 ?
| | [*] DA850/OMAP-L138/AM18x based system | |
- `1 |% A! ]8 @, @# A1 P a8 E | | [ ] Enable UART1 flow control | |/ T$ A" t% H5 a! e: O
| | [ ] Enable UART0 RS485 funcation | |
4 G( S# ~% T$ N8 ]2 R | | [*] Enable UART1 RS485 funcation
; Y5 b# A7 P- G0 r6 _: q
$ @' s7 m' T. l& e# F; `想了解详细的功能实现,也可以查看8250.c文件里面的;
# B& O- _2 b7 Xvoid serial8250_tx_chars(struct uart_8250_port *up): E; T/ ^) T& ~( i# {$ B
return;0 \0 N- E3 A, l% q9 j. T
}
$ ]$ D! d% O) O( M) e4 ^3 M* a
6 q9 f: l/ R! c$ p) ~ I0 e+#if 1
5 T& r7 s2 u9 \3 Q" p+ /* The funcation with RS485 flow control */
& A6 {: M; l' v+ if (up->port.private_data) {
/ B" } }( U6 h8 G2 \/ l+ struct serial8250_flow_ctrl *flow_ctrl_p;; Q. C* s! X! w! R1 H
+ flow_ctrl_p = up->port.private_data;2 ]6 r3 i' C2 Y( Q! A# e
+
2 p) A2 ?1 U1 l+ if (flow_ctrl_p->gpio) {6 R1 p5 q2 ^3 y0 B
+ gpio_set_value(flow_ctrl_p->gpio, 1);
5 e8 s& L1 `+ U4 ~+ ndelay(50); /* Propagation delay >= 50ns */, h a" s. V9 i @' S" z! x2 H
+ }) P" {( T* {5 ~
+ }
+ b( x- z5 X9 ]# h6 O C! ]5 j. B+#endif- {' ?! k2 k% W# o7 t
希望对您有帮助。
W/ ~3 c8 V0 P# Y8 Y |
|