Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
242 views
in Technique[技术] by (71.8m points)

beagleboard - Configuring Pins Mode Beaglebone

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

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

[offset] [mode]

Example: 0x030 0x07

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

I hope this helps :)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...