|
|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。
5 y% x9 }6 J# [" |' `2 C *** DaVinci Core Type *** | |
- J/ ]: ~; t1 a: | | | [ ] DaVinci 644x based system | |& V( {- G/ I) Z4 ~7 H" L& f. F
| | [ ] DaVinci 355 based system | |7 J/ o* O! l/ p/ \& @+ ]
| | [ ] DaVinci 646x based system | |
0 r6 E8 D1 [4 Y9 L- O | | [ ] DA830/OMAP-L137/AM17x based system | |+ ?, U' W1 {1 a5 z+ x( ~ |2 n
| | [*] DA850/OMAP-L138/AM18x based system | |
; f4 f0 K: A3 p7 d7 E9 v) g | | [ ] Enable UART1 flow control | |
4 q3 ]3 z% H$ U, j4 q; v | | [ ] Enable UART0 RS485 funcation | |
; n& P5 X0 B$ }0 |, n | | [*] Enable UART1 RS485 funcation
, m0 M9 ~) P7 {4 H) T" F5 Y/ m
* p9 f5 ]0 p/ r想了解详细的功能实现,也可以查看8250.c文件里面的;9 {: i# n6 Z; q9 V' a
void serial8250_tx_chars(struct uart_8250_port *up)
. j+ W4 o) X; i return;: E# j( H, ~) j- n5 K
}! L3 K* L+ |$ V5 y5 X2 r' ]3 E
6 K+ z, H4 y7 m' E+#if 1
/ y. U0 F% ]' x5 N9 `+ /* The funcation with RS485 flow control */
, _2 Q6 s- u, \. H+ if (up->port.private_data) {6 T; q6 K* S) ^/ a2 Y& _
+ struct serial8250_flow_ctrl *flow_ctrl_p;
& ~; z( i' N* H9 V/ H! I8 V3 h- n2 y* _+ flow_ctrl_p = up->port.private_data;
% H* ~; @, R% A; M/ E9 {" E1 a+
+ L" `5 f4 R) F$ M4 p& e7 C1 e+ if (flow_ctrl_p->gpio) {
# t2 F- }6 e+ {( @' i- i9 R& m+ gpio_set_value(flow_ctrl_p->gpio, 1);1 U5 J# T9 h; Q0 w% w0 x
+ ndelay(50); /* Propagation delay >= 50ns */( S9 X8 _. H9 G8 G% Z0 n$ ?$ {
+ }
, \' X: K: b4 U& F& W4 Z( T+ }
+ G$ O% ]1 S, l6 `" S$ Z+#endif1 Z/ D: |1 J g2 ?( E9 J# P
希望对您有帮助。
1 [$ ^2 S! I' k! @' q$ |# z2 M8 Z) L; h& p |
|