Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PRU GPIO EXAMPLE
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-green";
// identification
part-number = "PRU-GPIO-EXAMPLE";
version = "00A0";
// resources
exclusive-use =
"P8.13",
"pru0";
// pinmux
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
P8_13_default_pin: pinmux_P8_13_default_pin {
pinctrl-single,pins = <0x24 0x27>;
};
P8_13_gpio_pin: pinmux_P8_13_gpio_pin {
pinctrl-single,pins = <0x24 0x2f>;
};
};
};
// PRU
fragment@1 {
target = <&ocp>;
__overlay__ {
P8_13_pinmux {
compatible = "bone-pinmux-helper";
status = "okay";
pinctrl-names = "default", "gpio";
pinctrl-0 = <&P8_13_default_pin>;
pinctrl-1 = <&P8_13_gpio_pin>;
};
};
};
fragment@2 {
target = <&ocp>;
__overlay__ {
// !!!WARNING!!!
// gpio-of-helper &gpio pointers are off-by-one vs. the hardware:
// hardware GPIO bank 0 = &gpio1
cape {
compatible = "gpio-of-helper";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <>;
P8_13 {
gpio-name = "P8_13";
gpio = <&gpio1 23 0>;
input;
dir-changeable;
};
};
};
};
fragment@3 {
target = <&pruss>;
__overlay__ {
status = "okay";
};
};
};
@pranav083

This comment has been minimized.

Copy link

commented Jun 16, 2019

thanks a lot for your code. It really help me a lot learning the process of acessing the gpio through assembly code. but their is confusion that as you are using memory then why you are also using SET r30, r30, 15 as on line 43 and 53 as i checked using comment it out also the pin work as it is . So, If you can give a little explanation on this willl be helpful to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.