Advertisement
zmatt

stepper-pinmux.dtsi

May 19th, 2023 (edited)
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. #include "bone/black.h"
  2.  
  3. // note: P9.41 and P9.42 both connect to two processor pins each, which
  4. // cape-universal calls P9_41/42 and P9_91/92 respectively.
  5. USES_PIN(P9_41);
  6. USES_PIN(P9_91);
  7. USES_PIN(P9_42);
  8. USES_PIN(P9_92);
  9.  
  10. // create pinmux helper to switch between disabled and active states for
  11. // pruout pins, to allow userspace to initialize R30 before changing the pinmux
  12. / {
  13.     stepper-pinmux {
  14.         compatible = "bone-pinmux-helper";
  15.         pinctrl-names = "default", "active";
  16.         pinctrl-0 = <&stepper_unused_pins>, <&stepper_disabled_pins>;
  17.         pinctrl-1 = <&stepper_unused_pins>, <&stepper_active_pins>;
  18.     };
  19. };
  20.  
  21. &am33xx_pinmux {
  22.     stepper_unused_pins: stepper-unused {
  23.         pinctrl-single,pins = <
  24.             PIN_NOPULL( P9_41a, 7 )
  25.             PIN_NOPULL( P9_42a, 7 )
  26.         >;
  27.     };
  28.     stepper_disabled_pins: stepper-disabled {
  29.         pinctrl-single,pins = <
  30.             PIN_PULLDN( P9_41b, 7 )
  31.             PIN_PULLDN( P9_42b, 7 )
  32.         >;
  33.     };
  34.     stepper_active_pins: stepper-active {
  35.         pinctrl-single,pins = <
  36.             PIN_PULLDN( P9_41b, 5 )  // pru 0 out 6
  37.             PIN_PULLDN( P9_42b, 5 )  // pru 0 out 4
  38.         >;
  39.     };
  40. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement