|
|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。
& R7 D; x) r+ I( Z) k0 Y8 X *** DaVinci Core Type *** | |
+ `" I w: z) ?& r9 B: c+ w9 ~9 N | | [ ] DaVinci 644x based system | |* `- e- _# e/ o- I7 V+ p. Y# m
| | [ ] DaVinci 355 based system | |( o% F+ b# B7 T' X e
| | [ ] DaVinci 646x based system | |
# D" W% L4 H* `9 u& f | | [ ] DA830/OMAP-L137/AM17x based system | |
7 Z% T+ Z* E1 @8 X | | [*] DA850/OMAP-L138/AM18x based system | |. N( s" F6 J+ Q) r( c: r+ W
| | [ ] Enable UART1 flow control | |" [, o& F" t5 F$ Z0 @" d
| | [ ] Enable UART0 RS485 funcation | |
: a, H3 y _7 m8 o) _ | | [*] Enable UART1 RS485 funcation
+ y. f$ J8 T I* U# m
3 E) ~) B a! A! c想了解详细的功能实现,也可以查看8250.c文件里面的;
* W% g! C) ?5 Y, ~; avoid serial8250_tx_chars(struct uart_8250_port *up)/ I8 k" a2 F7 @3 N
return;$ O; O9 X3 q; p
}
* x& E1 D+ S( W$ e1 d, _; j: f- \& `
+#if 11 Z6 m' ?# S8 R- k
+ /* The funcation with RS485 flow control */# C$ [( N+ s, c8 w# u
+ if (up->port.private_data) {! p7 _, G, }: T# U" `& \( f2 e/ N
+ struct serial8250_flow_ctrl *flow_ctrl_p;
5 E0 R i" x6 S% |, F8 G0 S! I+ flow_ctrl_p = up->port.private_data;* V/ s2 |8 j1 o
+. `' B, S/ T- [* u( Z4 y$ ?2 n3 N
+ if (flow_ctrl_p->gpio) {
" @5 g# N/ H8 Z% j' `+ gpio_set_value(flow_ctrl_p->gpio, 1);
2 @# g9 l! Z- b+ ndelay(50); /* Propagation delay >= 50ns */
6 v- b7 `! b* F+ k$ ~2 b+ }
M& D& n4 ?! A B& z, C3 N% e+ }
5 g- e5 L; U$ k- \; ?+#endif9 ?! M0 Y! a# l# B# ~! O
希望对您有帮助。
+ V& ~1 ]* y$ g! @) `* @ |
|