Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "bone/black.h"
- #include "gpio.h"
- // XXX not compatible with cape-universal!
- // Requires a sufficiently recent kernel by rcn (4.9-bone or 4.9-ti).
- //
- // A udev rule along these lines is recommended:
- //
- // SUBSYSTEM=="subsystem", KERNEL=="gpio", ACTION=="add", \
- // RUN+="/bin/mkdir -p /dev/gpio"
- //
- // SUBSYSTEM=="gpio", ACTION=="add", TEST=="value", ATTR{label}!="sysfs", \
- // RUN+="/bin/ln -sT '/sys/class/gpio/%k' /dev/gpio/%s{label}"
- / {
- // If you want to use multiple overlays that do gpio configuration, be
- // sure that each uses a different device tree node!
- gpio-demo {
- compatible = "gpio-of-helper";
- // It is usually not *strictly* required to perform pinmux for
- // GPIOs since this is typically their default, but it's good
- // practice to do it anyway since:
- // 1. it makes *sure* the pinmux is right
- // 2. you can configure internal pull-up/down
- // 3. it lets the kernel know the pins are in use
- pinctrl-names = "default";
- pinctrl-0 = <&gpio_demo_pins>;
- // Note that gpio numbers for each pin can be found in the
- // comments in include/bone/black.h
- // custom (new) configuration
- bms_key_on {
- gpio = <&gpio1 17 ACTIVE_HIGH>; // P9.23
- output;
- init-low;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement