Skip to content

Commit

Permalink
Added examples for bicolor LEDs
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliomoro committed Sep 24, 2017
1 parent fd50552 commit 12f3110
Show file tree
Hide file tree
Showing 4 changed files with 457 additions and 0 deletions.
Binary file not shown.
208 changes: 208 additions & 0 deletions examples/02-Digital/bicolor-LEDs/MY-PWM-01-00A0.dts
@@ -0,0 +1,208 @@
// Copyright 2013
// Charles Steinkuehler <charles@steinkuehler.net>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

/dts-v1/;
/plugin/;

/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";

/* identification */
part-number = "cape-bone-universaln";
version = "00A0";

/* state the resources this cape uses */
exclusive-use =

"P9.14",
"P9.16",
"ehrpwm1A",
"ehrpwm1B";

fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {

/************************/
/* P8 Header */
/************************/

/* P9_14 (ZCZ ball U14) */
P9_14_default_pin: pinmux_P9_14_default_pin {
pinctrl-single,pins = <0x048 0x27>; }; /* Mode 7, Pull-Down, RxActive */
P9_14_gpio_pin: pinmux_P9_14_gpio_pin {
pinctrl-single,pins = <0x048 0x2F>; }; /* Mode 7, RxActive */
P9_14_gpio_pu_pin: pinmux_P9_14_gpio_pu_pin {
pinctrl-single,pins = <0x048 0x37>; }; /* Mode 7, Pull-Up, RxActive */
P9_14_gpio_pd_pin: pinmux_P9_14_gpio_pd_pin {
pinctrl-single,pins = <0x048 0x27>; }; /* Mode 7, Pull-Down, RxActive */
P9_14_pwm_pin: pinmux_P9_14_pwm_pin {
pinctrl-single,pins = <0x048 0x26>; }; /* Mode 6, Pull-Down, RxActive */

/* P9_16 (ZCZ ball T14) */
P9_16_default_pin: pinmux_P9_16_default_pin {
pinctrl-single,pins = <0x04c 0x27>; }; /* Mode 7, Pull-Down, RxActive */
P9_16_gpio_pin: pinmux_P9_16_gpio_pin {
pinctrl-single,pins = <0x04c 0x2F>; }; /* Mode 7, RxActive */
P9_16_gpio_pu_pin: pinmux_P9_16_gpio_pu_pin {
pinctrl-single,pins = <0x04c 0x37>; }; /* Mode 7, Pull-Up, RxActive */
P9_16_gpio_pd_pin: pinmux_P9_16_gpio_pd_pin {
pinctrl-single,pins = <0x04c 0x27>; }; /* Mode 7, Pull-Down, RxActive */
P9_16_pwm_pin: pinmux_P9_16_pwm_pin {
pinctrl-single,pins = <0x04c 0x26>; }; /* Mode 6, Pull-Down, RxActive */
};
};


/************************/
/* Pin Multiplexing */
/************************/

fragment@1 {
target = <&ocp>;
__overlay__ {

/************************/
/* P8 Header */
/************************/

P9_14_pinmux {
compatible = "bone-pinmux-helper";
status = "okay";
pinctrl-names = "default", "gpio", "gpio_pu", "gpio_pd", "pwm";
pinctrl-0 = <&P9_14_default_pin>;
pinctrl-1 = <&P9_14_gpio_pin>;
pinctrl-2 = <&P9_14_gpio_pu_pin>;
pinctrl-3 = <&P9_14_gpio_pd_pin>;
pinctrl-4 = <&P9_14_pwm_pin>;
};

P9_16_pinmux {
compatible = "bone-pinmux-helper";
status = "okay";
pinctrl-names = "default", "gpio", "gpio_pu", "gpio_pd", "pwm";
pinctrl-0 = <&P9_16_default_pin>;
pinctrl-1 = <&P9_16_gpio_pin>;
pinctrl-2 = <&P9_16_gpio_pu_pin>;
pinctrl-3 = <&P9_16_gpio_pd_pin>;
pinctrl-4 = <&P9_16_pwm_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-universal {
compatible = "gpio-of-helper";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <>;
P9_14 {
gpio-name = "P9_14";
gpio = <&gpio2 18 0>;
input;
dir-changeable;
};
P9_16 {
gpio-name = "P9_16";
gpio = <&gpio2 19 0>;
input;
dir-changeable;
};
};
};
};



/************************/
/* PWM */
/************************/

fragment@20 {
target = <&epwmss0>;
__overlay__ {
status = "okay";
};
};

fragment@21 {
target = <&ehrpwm0>;
__overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <>;
};
};

fragment@22 {
target = <&ecap0>;
__overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <>;
};
};

fragment@23 {
target = <&epwmss1>;
__overlay__ {
status = "okay";
};
};

fragment@24 {
target = <&ehrpwm1>;
__overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <>;
};
};

fragment@25 {
target = <&epwmss2>;
__overlay__ {
status = "okay";
};
};

fragment@26 {
target = <&ehrpwm2>;
__overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <>;
};
};

fragment@27 {
target = <&ecap2>;
__overlay__ {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <>;
};
};

};

0 comments on commit 12f3110

Please sign in to comment.