配置引脚模式Beaglebone [英] Configuring Pins Mode Beaglebone

查看:195
本文介绍了配置引脚模式Beaglebone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在beagleboard或beaglebone中,有不同的模式可以使用图钉.对于先前的内核,它们位于/sys/kernel/debug/omap_mux中.您知道最后一个内核中的那些文件在哪里吗?

In the beagleboard or beaglebone are different modes to work the pin. With the previous kernel they are located in /sys/kernel/debug/omap_mux. Do u know with the last Kernel where are those files?

推荐答案

我发现赶时髦的人提供的许多示例有些让人不知所措.特别是如果您只是想将引脚调整为模式7.如果阅读此文件的人遇到相同的问题,则以下链接可能会有所帮助:

I found many of the examples provided at hipstercircuits to be a bit overwhelming; especially if you're just looking to adjust the pins to mode 7. If anyone reading this is having the same issue, the following link may help: http://bbbadventures.blogspot.ca/2013/06/pinmuxing.html It provides the most basic template.

如果上面的链接中断了,下面是提供的代码段(为清楚起见,进行了一些调整):

Should the link above break, here's the snippet provided (with a few tweaks for clarity):

/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/plugin/;

/ { compatible = "ti,beaglebone", "ti,beaglebone-black";
    /* identification */
    part-number = "pinctrl-test-0";
    fragment@0 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            pinctrl_test: pinctrl_test_0_pins {
                pinctrl-single,pins = <
                    0x030 0x07 /* P8_12 OUTPUT | MODE7 */
                    0x034 0x07 /* P8_11 OUTPUT | MODE7 */
                    /* Add more pins here */
                >;
            };
        };
    };

    fragment@1 {
        target = <&ocp>;
        __overlay__ {
            test_helper: helper {
                compatible = "bone-pinmux-helper";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_test>;
                status = "okay";
            };
        };
    };
};

在上述代码段中添加更多引脚时,您可以使用下表确定哪些十六进制值与引脚匹配:

When adding more pins to the above snippet, you can use the following tables to identify which hex values match the pins:

  • https://github.com/derekmolloy/boneDeviceTree/blob/master/docs/BeagleboneBlackP8HeaderTable.pdf?raw=true
  • https://github.com/derekmolloy/boneDeviceTree/blob/master/docs/BeagleboneBlackP9HeaderTable.pdf?raw=true

通过在pinctrl-single,pins中附加一个额外的条目来设置每个pin.格式如下:

Each pin is set by appending an additional entry into pinctrl-single,pins. The format looks like this:

[偏移] [模式]

[offset] [mode]

例如:0x030 0x07

Example: 0x030 0x07

在上面链接的两个表中,请参考标题为"ADDR/OFFSET"的第三列,以获取偏移值.

In the two tables linked above refer to the third column, entitled "ADDR/OFFSET", for the offset value.

我希望这会有所帮助:)

I hope this helps :)

我还要提到,马丁和唐提供的答案都很出色,应该有助于涵盖其余的重要细节.

I should also mention that the answers provided by Martin and Don are both excellent should help cover the rest of the important details.

这篇关于配置引脚模式Beaglebone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆