fivdi
Posts: 203
Joined: Sun Sep 23, 2012 8:09 pm
Contact: Website

Device tree overlay for an LED

Tue Jan 27, 2015 9:49 pm

I just wrote my first device tree overlay for an LED and it works :D
The source code can be seen below.
What I don't know is whether or not this is the correct, recommended, or a reasonable way to do it or if there's a better way.

I'd be very grateful if someone reviewed the code and let me know if it's ok or can be improved.

Code: Select all

/dts-v1/;
/plugin/;

/ {
    compatible = "brcm,bcm2708";

    [email protected] {
        target = <&leds>;
        __overlay__ {
            my_led: myled {
                label = "MYLED";
                gpios = <&gpio 14 0>;
                linux,default-trigger = "heartbeat";
            };
        };
    };
};

User avatar
vesteraas
Posts: 15
Joined: Wed Apr 10, 2013 4:46 pm

Re: Device tree overlay for an LED

Wed Jan 28, 2015 7:48 am

Nice! It would be interesting to know what resources you used to learn this. Do you have any links?

ktb
Posts: 1380
Joined: Fri Dec 26, 2014 7:53 pm

Re: Device tree overlay for an LED

Wed Jan 28, 2015 8:15 am

vesteraas wrote:Nice! It would be interesting to know what resources you used to learn this. Do you have any links?
I'm not sure whether or not this is completely up-to-date, but I read about the new device tree stuff here https://github.com/raspberrypi/document ... ce-tree.md


User avatar
vesteraas
Posts: 15
Joined: Wed Apr 10, 2013 4:46 pm

Re: Device tree overlay for an LED

Wed Jan 28, 2015 9:05 pm

Thanks!

Return to “Advanced users”

Who is online

Users browsing this forum: grafin and 20 guests