嵌入式开发者社区
标题:
关于RS485控制引脚
[打印本页]
作者:
zhaohui293
时间:
2014-10-31 17:01
标题:
关于RS485控制引脚
本帖最后由 zhaohui293 于 2014-10-31 17:05 编辑
. C% N% E0 V* E3 R. i; s
5 g6 Y- F G5 @5 h
我的板子修改了RS485收发控制引脚,不知道在驱动的哪个位置修改RS485控制引脚,在8250.c的哪个位置,
: e7 r2 B1 b3 n
2 G! a/ x$ }( k$ H6 s3 C6 {
# _$ z5 a2 D" ^' Y, y& }1 |
作者:
teddy
时间:
2014-10-31 17:21
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。
. O, [. a: k5 W. c$ V/ \0 D: p( Y
*** DaVinci Core Type *** | |
& r5 n: ]( D% K& M w% J
| | [ ] DaVinci 644x based system | |
& [( i5 Y5 f- t6 Z7 _# O
| | [ ] DaVinci 355 based system | |
; {4 [* f4 D' \3 t. N/ b* D0 W
| | [ ] DaVinci 646x based system | |
) z$ B! U7 |$ m( ?8 Y
| | [ ] DA830/OMAP-L137/AM17x based system | |
( s& x; y& |2 E3 n/ X5 v0 t/ f- G9 m
| | [*] DA850/OMAP-L138/AM18x based system | |
3 F) ?- z( L1 y: E+ [+ p
| | [ ] Enable UART1 flow control | |
: M. _' r0 e u5 o0 v; h& n
| | [ ] Enable UART0 RS485 funcation | |
2 h4 I1 [2 o( M' w' X& M
| | [*] Enable UART1 RS485 funcation
/ ]; s2 f9 g, n" K1 _7 w3 C9 I
9 H8 I2 o* T) D# C
想了解详细的功能实现,也可以查看8250.c文件里面的;
( n9 S, ^/ U, _1 I% @
void serial8250_tx_chars(struct uart_8250_port *up)
1 |/ G2 |4 O8 b9 D' M
return;
! q; I/ o' U N/ N/ i, s; C/ O C3 z
}
0 u3 s6 P- z6 K; }) c
* A) W4 T) B# v; v! _% [1 U
+#if 1
3 ?) R. l. g' Q) d$ S
+ /* The funcation with RS485 flow control */
7 E, U+ E$ b* y
+ if (up->port.private_data) {
2 ]: G/ J5 C. \5 L3 b' Y" t
+ struct serial8250_flow_ctrl *flow_ctrl_p;
' f" @/ e+ n- l2 O" N6 g% ~
+ flow_ctrl_p = up->port.private_data;
3 ]1 s: T; [, G Q! G1 o% ~. S
+
4 C; |! \/ w2 e L+ v" R( _
+ if (flow_ctrl_p->gpio) {
1 c8 d# [1 E) |/ G# ]" m! W
+ gpio_set_value(flow_ctrl_p->gpio, 1);
; I3 c( f% j8 q
+ ndelay(50); /* Propagation delay >= 50ns */
. }8 _# G8 c8 J* A) X" i
+ }
9 \7 f3 j. r1 }/ S' ~( p5 T1 f8 {
+ }
' ~- I2 W2 n# ~! T- O: j+ N, _& g
+#endif
& y7 {. }/ u1 B. L7 v
希望对您有帮助。
+ n! E7 J" Z7 y4 D
作者:
zhaohui293
时间:
2014-10-31 17:28
你说的serial8250_tx_chars函数没有你下面写的部分啊
+ S, R# W/ B" J* M5 [
( z' m7 y" d# e: d* ~
作者:
teddy
时间:
2014-10-31 18:07
请跟创龙的技术支持获取最新的linux3.3内核源码。
+ @; [' p, R5 _6 E4 H
作者:
2532609929
时间:
2014-10-31 19:35
zhaohui293 发表于 2014-10-31 17:28
8 ?* U$ K9 O. W2 a0 b! M( M& y
你说的serial8250_tx_chars函数没有你下面写的部分啊
8 x6 V. ?1 \$ N% U
在最新的源码中有的,我记得发过给你的了,请使用最新的内核源码
2 o/ h. P* ]* t7 N
作者:
sddxzzf
时间:
2014-11-18 17:20
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 嵌入式开发者社区 (https://www.51ele.net/)
Powered by Discuz! X3.4