如何設計其它的uart

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

如何設計其它的uart

ソリューションへジャンプ
1,382件の閲覧回数
陳冠儒
Contributor IV

Hi,大家:

小弟有些code設計的問題想請教大家一下,因為我在L3.10.53 BSP source code中imx6qdl-sabresd.dtsi()只有看到uart1的設計,如下:

&uart1 {

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_uart1_1>;

status = "okay";

};

那我若是有新硬體uart2、uart4、uart5(各含有TX,RX,RTS,CTS  4個信號),那我應該怎麼設計code比較好呢?因為原始code寫法是針對debug prot(TX,RX)設計,故不知能直接拿來用嗎?

例如:

寫一個很像的

&uart2 {

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_uart2_1>;

status = "okay";

};

這樣不知道可否?

然後在原始code  mx6sabresd.c中如下:

iomux_v3_cfg_t const uart1_pads[] = {

MX6_PAD_CSI0_DAT10__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),

MX6_PAD_CSI0_DAT11__UART1_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),

};

我可以多寫一個如下的設定嗎:

iomux_v3_cfg_t const uart2_pads[] = {

MX6_PAD_CSI0_DAT14__UART2_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),

MX6_PAD_CSI0_DAT15__UART2_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),

MX6_PAD_CSI0_DAT18__UART2_RTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),

MX6_PAD_CSI0_DAT19__UART2_CTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),

};

然後這又該如何驅動呢?因為uart1靠如下驅動:

static void setup_iomux_uart(void)

{

imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));

}

還是不能這樣寫,再麻煩大家幫忙一下了,感謝大家。

(初學修改code,不是很熟,請大家見諒~~~)

ラベル(4)
1 解決策
1,006件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi 陳 冠儒

for other uarts examples one can at sabreai dts files, imx6qdl-sabreauto.dtsi:

Linux/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi - Linux Cross Reference - Free Electrons

Linux/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt - Linux Cross Reference - Free Elect...

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

3 返答(返信)
1,007件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi 陳 冠儒

for other uarts examples one can at sabreai dts files, imx6qdl-sabreauto.dtsi:

Linux/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi - Linux Cross Reference - Free Electrons

Linux/Documentation/devicetree/bindings/serial/fsl-imx-uart.txt - Linux Cross Reference - Free Elect...

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

1,006件の閲覧回数
陳冠儒
Contributor IV

hi,igorpadykov:

thanks for you help,sorry .

Article, I do not see very clearly.

how to do is write the article.

tnanks for you.

0 件の賞賛
返信
1,006件の閲覧回数
陳冠儒
Contributor IV

0 件の賞賛
返信