|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。. e! e- F0 e# r) _6 W
*** DaVinci Core Type *** | |
: q" k+ C) r2 V6 m( | | | [ ] DaVinci 644x based system | |
* ?0 ]+ q1 m+ o | | [ ] DaVinci 355 based system | |# R& ]4 v: A; X/ V' x% {1 O
| | [ ] DaVinci 646x based system | |7 d3 S5 d: S- o2 q) H
| | [ ] DA830/OMAP-L137/AM17x based system | |
. H$ ~, h4 M9 k; r$ f | | [*] DA850/OMAP-L138/AM18x based system | |3 Y7 A% [; j5 C, d3 P$ u6 `+ o2 X
| | [ ] Enable UART1 flow control | |
* a# W& {: Z2 T8 D! D | | [ ] Enable UART0 RS485 funcation | |: z) U; q6 i+ U5 f' f
| | [*] Enable UART1 RS485 funcation 2 ? @9 t9 f1 y/ k7 X! C; J$ D( c
; T ^/ @3 C% n' e# U想了解详细的功能实现,也可以查看8250.c文件里面的;
# L1 f* X& f9 p+ ?1 x6 |! ]void serial8250_tx_chars(struct uart_8250_port *up)& `0 Y7 ]3 e+ t. v) y
return;
2 Z* I- e7 \% r1 V3 b' V3 Q } ^7 p% ~ n7 j
3 t Z3 w" z5 C; V8 U& j; i
+#if 1
) X- W+ y: M. T6 c+ /* The funcation with RS485 flow control */
+ P+ T" z; M. q" ~# B# w+ if (up->port.private_data) {
# ?: u, r0 A/ e. c3 Q+ struct serial8250_flow_ctrl *flow_ctrl_p;
# {$ K9 x4 I) H- J' f2 ?+ flow_ctrl_p = up->port.private_data;
+ ]: s7 p) c; o+, k$ M6 s z5 l! s
+ if (flow_ctrl_p->gpio) {7 I- d& w, [+ U+ U# V
+ gpio_set_value(flow_ctrl_p->gpio, 1);
+ i% y& x* Z- ?$ k$ E6 E+ Z |+ ndelay(50); /* Propagation delay >= 50ns */4 f7 X5 M! T2 D& X; O8 j t6 ?" R8 }
+ }7 {5 T; Q1 L( v) D2 t
+ }4 A7 W$ A5 r+ p6 w
+#endif
2 V3 ~ P1 R3 F) K X希望对您有帮助。9 c+ Y. |+ y; w7 q6 N. u8 {. a3 O/ y+ u
|
|