|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。) D) A. I" q3 @2 G; s2 q7 i
*** DaVinci Core Type *** | |
3 O& n4 T, l4 V* T' z X% e8 ^ | | [ ] DaVinci 644x based system | |
3 ` O" C6 _- D" L- n+ J# v | | [ ] DaVinci 355 based system | |
! `- F8 W: ?( c' n1 ^! X0 o4 g | | [ ] DaVinci 646x based system | |( T+ C: ~' N. u0 [. h9 d
| | [ ] DA830/OMAP-L137/AM17x based system | |/ J- F8 b/ ?$ @* m
| | [*] DA850/OMAP-L138/AM18x based system | |; d$ ^/ C* D% s, N9 y
| | [ ] Enable UART1 flow control | |
' U y6 g+ e: t! u4 j; P | | [ ] Enable UART0 RS485 funcation | |1 y/ n* B0 s9 S8 h: B7 M3 m
| | [*] Enable UART1 RS485 funcation
; g( f; M l9 R" K
3 e; w) I8 E t. b想了解详细的功能实现,也可以查看8250.c文件里面的;
" J) H$ N4 I) C0 \: Dvoid serial8250_tx_chars(struct uart_8250_port *up)
, C4 [! ~, ]9 k2 Y return;* K% y D5 j) \9 Z2 u. @
}
# w2 ^( _( H2 M, d$ j- `; d1 t. g2 J1 g! |
+#if 1: y) R: y* R+ a; |* r% M: s
+ /* The funcation with RS485 flow control */8 L0 q- y- [* ]
+ if (up->port.private_data) {
: J* u, _% `" K+ struct serial8250_flow_ctrl *flow_ctrl_p;2 F: j! A7 \% O1 i, O
+ flow_ctrl_p = up->port.private_data;3 Q' Q! j$ J8 ]# r
+4 R# I. N* z8 n& J& n4 u
+ if (flow_ctrl_p->gpio) {
4 D) C! H0 G% G# l2 i( I! A+ gpio_set_value(flow_ctrl_p->gpio, 1);
. I9 u' i3 v! i8 A; o3 C, {+ ndelay(50); /* Propagation delay >= 50ns */& }& e7 q1 S( k |
+ }
; |: E- j1 o6 S7 K+ }% `* D9 D- \8 V% D) Q& F" h# t
+#endif
. a4 Y4 E! ~2 Y/ F希望对您有帮助。
$ g% T# R8 `/ z+ O |
|