|
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。
- P6 J4 e0 u$ l% N$ x/ y *** DaVinci Core Type *** | |) H0 M# H' G; U1 n
| | [ ] DaVinci 644x based system | |8 D, t$ j: I8 B! w ^" P' j
| | [ ] DaVinci 355 based system | |, }: H/ A5 [ ^9 o4 E
| | [ ] DaVinci 646x based system | |# t6 X( _8 C: b' L6 y4 m
| | [ ] DA830/OMAP-L137/AM17x based system | |
9 A( Z5 h' B- h* N) y: n | | [*] DA850/OMAP-L138/AM18x based system | |. h# b$ G8 e Z. a
| | [ ] Enable UART1 flow control | |; _, O3 ~" t$ \" r( n* K
| | [ ] Enable UART0 RS485 funcation | |! x$ h* v1 R# g- I; r7 f
| | [*] Enable UART1 RS485 funcation
% Q. [# e& Q% ], {& x
* `# ?2 V0 t2 b: C& r3 h' r想了解详细的功能实现,也可以查看8250.c文件里面的;- R1 P, c4 n- G! v4 N& U
void serial8250_tx_chars(struct uart_8250_port *up)( u! ~- G4 F6 K, C
return;4 K" ^# A- [2 ?4 I6 c2 ^
}* r6 ?. V8 w( K/ ~; x' |+ n
: w7 W% o( C7 T# f- S+#if 1
' M" n/ O2 ^" b* n7 p+ /* The funcation with RS485 flow control */
) c# x7 K. L5 H% f2 [- ]+ if (up->port.private_data) {
4 @" A- x$ N( @$ M! t+ struct serial8250_flow_ctrl *flow_ctrl_p;; ~+ z* b( r, V g7 a4 f7 w% j5 J/ X
+ flow_ctrl_p = up->port.private_data;
9 t0 v+ T$ h9 Y6 N- F, D( B+
0 ^' j( I- k3 v7 x1 Q6 b+ if (flow_ctrl_p->gpio) {. n! Q0 @% a- S; F+ G+ T& E( g
+ gpio_set_value(flow_ctrl_p->gpio, 1);
4 _, C( Y$ U# Q* g6 H" o+ ndelay(50); /* Propagation delay >= 50ns */3 q) C) V5 [4 V! w
+ }
' I9 i2 h, |! C- K( m$ r+ }
% U* h0 t: ]8 O9 ]1 C/ i3 K+ C* ~+#endif2 M) W9 U! S% V
希望对您有帮助。( w) s4 X% K7 }/ N" T! L
|
|