Advertisement
Guest User

Untitled

a guest
Sep 16th, 2021
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #include "bone/black.h"
  2. #include "gpio.h"
  3.  
  4. // XXX not compatible with cape-universal!
  5.  
  6. // Requires a sufficiently recent kernel by rcn (4.9-bone or 4.9-ti).
  7. //
  8. // A udev rule along these lines is recommended:
  9. //
  10. // SUBSYSTEM=="subsystem", KERNEL=="gpio", ACTION=="add", \
  11. // RUN+="/bin/mkdir -p /dev/gpio"
  12. //
  13. // SUBSYSTEM=="gpio", ACTION=="add", TEST=="value", ATTR{label}!="sysfs", \
  14. // RUN+="/bin/ln -sT '/sys/class/gpio/%k' /dev/gpio/%s{label}"
  15.  
  16. / {
  17. // If you want to use multiple overlays that do gpio configuration, be
  18. // sure that each uses a different device tree node!
  19. gpio-demo {
  20. compatible = "gpio-of-helper";
  21.  
  22. // It is usually not *strictly* required to perform pinmux for
  23. // GPIOs since this is typically their default, but it's good
  24. // practice to do it anyway since:
  25. // 1. it makes *sure* the pinmux is right
  26. // 2. you can configure internal pull-up/down
  27. // 3. it lets the kernel know the pins are in use
  28. pinctrl-names = "default";
  29. pinctrl-0 = <&gpio_demo_pins>;
  30.  
  31. // Note that gpio numbers for each pin can be found in the
  32. // comments in include/bone/black.h
  33.  
  34. // custom (new) configuration
  35. bms_key_on {
  36. gpio = <&gpio1 17 ACTIVE_HIGH>; // P9.23
  37. output;
  38. init-low;
  39. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement