嵌入式开发者社区

标题: 关于RS485控制引脚 [打印本页]

作者: zhaohui293    时间: 2014-10-31 17:01
标题: 关于RS485控制引脚
本帖最后由 zhaohui293 于 2014-10-31 17:05 编辑
8 c# J+ q/ b% g. c7 ?
# i1 G* a: }0 Z1 P我的板子修改了RS485收发控制引脚,不知道在驱动的哪个位置修改RS485控制引脚,在8250.c的哪个位置,! k' V1 u* \$ |7 d
9 W$ B! }4 f% g5 Z2 ?( S; j/ w

7 n4 E) N; U0 O1 j; l' t7 I
作者: teddy    时间: 2014-10-31 17:21
您好!tronlong提供的最新的linux3.3内核已经对uart0和uart1做了rs485功能的支持,uart2默认为启动串口。如何想使能uart0和uart1 rs485的功能,只需在menuconfig将485使能。( y" ^! W1 v$ [3 l
  *** DaVinci Core Type ***                                                              | |
9 l0 m5 A( T% B5 Y% }6 n: c  U  | |                    [ ] DaVinci 644x based system                                                              | |
2 M0 n5 |! R. f& D1 a2 b  | |                    [ ] DaVinci 355 based system                                                               | |
& y: m3 s) q& c, a6 S9 X. B" M  | |                    [ ] DaVinci 646x based system                                                              | |
3 C! t* E$ |/ X# T7 S7 ~) a3 m! u  | |                    [ ] DA830/OMAP-L137/AM17x based system                                                     | |6 `9 C8 l; U4 z) M) X
  | |                    [*] DA850/OMAP-L138/AM18x based system                                                     | |9 c: J6 h2 o  y  Q1 s2 V
  | |                    [ ]   Enable UART1 flow control                                                            | |
/ M$ L) P* g- J5 |  | |                    [ ]   Enable UART0 RS485 funcation                                                         | |; V/ g& v1 Q+ y" B% x
  | |                    [*]   Enable UART1 RS485 funcation
' P9 T4 \( V& l! x- o* p( m" z
+ p  G0 A  w/ `6 c  o) c想了解详细的功能实现,也可以查看8250.c文件里面的;: _. ~  a) a% z+ n
void serial8250_tx_chars(struct uart_8250_port *up)  K( J  `7 c; B- z
                return;
8 ~  }5 N" o2 x/ `! x        }
! H* T% |! e/ p" y7 q
5 P& ?$ S9 w+ e# r+#if 1
9 ~2 `6 D4 T+ I% @9 G+       /* The funcation with RS485 flow control */
5 q' X* q# L& ~+ m! x: E+       if (up->port.private_data) {
  ]1 C/ Q! f, b1 T/ A+               struct serial8250_flow_ctrl *flow_ctrl_p;- K3 H, H: A; B) s# `7 G
+               flow_ctrl_p = up->port.private_data;
* ?( `' W& h, P  p8 T+
* t2 [5 w8 }, p9 C$ k# T+ q! Y+               if (flow_ctrl_p->gpio) {* g! J# Z! G5 Z, ]- e6 a
+                       gpio_set_value(flow_ctrl_p->gpio, 1);  ~0 x5 W: M+ A
+                       ndelay(50); /* Propagation delay >= 50ns */
& b3 B4 B: g6 V( A3 g8 {8 d' d+               }
. M) O+ M5 W6 [6 a( ~8 }* }; Z5 x+       }& Q# N# Y" V. g7 g1 D; D
+#endif9 @+ U5 a+ U; l6 m* b
希望对您有帮助。
" _5 n+ r: I3 ^' q3 M
作者: zhaohui293    时间: 2014-10-31 17:28
你说的serial8250_tx_chars函数没有你下面写的部分啊
( G4 @, @4 ?1 I9 ~/ x1 \( G! s9 R# c$ R$ _( F) u0 V4 |

作者: teddy    时间: 2014-10-31 18:07
请跟创龙的技术支持获取最新的linux3.3内核源码。
. C% c2 t2 k1 l
作者: 2532609929    时间: 2014-10-31 19:35
zhaohui293 发表于 2014-10-31 17:284 ^8 [* l6 P9 o% @: G7 D
你说的serial8250_tx_chars函数没有你下面写的部分啊

$ D7 s! {' X) n' [5 D在最新的源码中有的,我记得发过给你的了,请使用最新的内核源码) j/ J3 J" I* ^- f, i( G5 I

作者: sddxzzf    时间: 2014-11-18 17:20
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 嵌入式开发者社区 (https://www.51ele.net/) Powered by Discuz! X3.4