Configuring Pins Mode Beaglebone

后端 未结 6 2038
没有蜡笔的小新
没有蜡笔的小新 2020-12-10 08:02

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

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 08:53

    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

    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.

提交回复
热议问题