Skip to content

Commit

Permalink
Fixes Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucassifoni committed Feb 24, 2024
1 parent 9c84f5c commit 39d39f1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 11 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# dts-buddy
Research on a device tree source buddy to help people compile & load DTBOs at runtime in Elixir
Research on a device tree source buddy to help people compile & load DTBOs at runtime in Elixir

DtsBuddy is meant to provide utilities to handle runtime loading of
device tree overlays, while reducing the ceremony required by the
Expand Down Expand Up @@ -38,7 +38,28 @@ Research on a device tree source buddy to help people compile & load DTBOs a
provided by Frank Hunleth.

iex> import DtsBuddy.Sigil
#{File.read!("sample_dt.dts")}
iex> ~DTS"""
/dts-v1/;
/plugin/;

/* Compile:
dtc -@ -I dts -O dtb -o gpio_led.dtbo gpio_led.dts
*/

&{/} {
gpios_leds {
compatible = "gpio-leds";
test_led@36 {
label = "test-led-gpio36";
gpios = <&pio 1 4 0>; /* GPIO36/PB4 */

/* Blink LED at 1 Hz (500 ms on, off) */
linux,default-trigger = "pattern";
led-pattern = <1 500 1 0 0 500 0 0>;
};
};
};
"""test_led
{:ok, "/data/test_led.dtbo", "test_led"}


Expand Down
24 changes: 15 additions & 9 deletions sample_dt.dts
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@

iex> ~DTS"""
/dts-v1/;
/plugin/;
&{/} {
/dts-v1/;
/plugin/;

/* Compile:
dtc -@ -I dts -O dtb -o gpio_led.dtbo gpio_led.dts
*/

&{/} {
gpios_leds {
compatible = "gpio-leds";
test_led@36 {
label = "test-led-gpio36";
gpios = <&pio 1 4 0>; /* GPIO36/PB4 */
/* Blink LED at 1 Hz (500 ms on, off) */
linux,default-trigger = "pattern";
led-pattern = <1 500 1 0 0 500 0 0>;
label = "test-led-gpio36";
gpios = <&pio 1 4 0>; /* GPIO36/PB4 */

/* Blink LED at 1 Hz (500 ms on, off) */
linux,default-trigger = "pattern";
led-pattern = <1 500 1 0 0 500 0 0>;
};
};
};
};
"""test_led

0 comments on commit 39d39f1

Please sign in to comment.