|
|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。: A8 d: P+ l5 K+ I& b
*** DaVinci Core Type *** | |# J1 Q% V7 S- E
| | [ ] DaVinci 644x based system | |
5 I/ B, J* C9 h. w* R; R | | [ ] DaVinci 355 based system | |' ?4 D6 j+ t- Y- O
| | [ ] DaVinci 646x based system | |3 `' C% M6 M f0 s+ Q" y% Q1 U
| | [ ] DA830/OMAP-L137/AM17x based system | |. x% L" d7 v* o1 ~$ }
| | [*] DA850/OMAP-L138/AM18x based system | |
# E' k& X% F. m | | [ ] Enable UART1 flow control | |8 L1 S) B5 i7 V: Z7 D S& l, _
| | [ ] Enable UART0 RS485 funcation | |5 ^2 W& _# s4 H
| | [*] Enable UART1 RS485 funcation
. v9 \0 ^/ R9 s7 b8 L3 p- w7 i+ F8 @+ U) F7 Z6 m( P
想了解详细的功能实现,也可以查看8250.c文件里面的;8 q0 K$ J8 n7 U. Y) R& ?
void serial8250_tx_chars(struct uart_8250_port *up)
, Q8 T5 t+ k' q" x9 K% o2 \: M1 J. ^ return;
' ], e `+ _% p' L F+ V }- P, j) r- b, q
, @' a- P0 \6 l) V
+#if 1* U5 }8 a! b5 C" d4 ]- r" e
+ /* The funcation with RS485 flow control */
, P# Q8 j+ S: n" h3 i: r% X+ if (up->port.private_data) {$ F2 }( }6 |2 w; I
+ struct serial8250_flow_ctrl *flow_ctrl_p;7 ^1 T3 Z! _! i9 _' v: }
+ flow_ctrl_p = up->port.private_data;; F; G# u! t1 L5 C6 u. m/ n& L
+
* n J' U- N- d! Q2 r- v D. l' i+ if (flow_ctrl_p->gpio) {
" q- n* X( W. r+ gpio_set_value(flow_ctrl_p->gpio, 1);8 ^" [* n: E! U/ U, Q, ` ]0 V5 Y/ T) H
+ ndelay(50); /* Propagation delay >= 50ns */
& c/ g8 W, A" F- z; [. u; E; L+ }
* i& f4 D8 A; @+ o* n+ }
. G: L' A9 l2 g& M* H3 c" N+#endif9 f& g/ O: ^6 H4 J
希望对您有帮助。& _3 @2 S7 p* ]$ v' w' T: F! \. L# b
|
|