Guest User

Untitled

a guest
Jun 22nd, 2021
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. /dts-v1/;
  2. /plugin/;
  3.  
  4. /*
  5. Legal pin,function combinations for each channel:
  6. PWM0: 12,4(Alt0) 18,2(Alt5) 40,4(Alt0) 52,5(Alt1)
  7. PWM1: 13,4(Alt0) 19,2(Alt5) 41,4(Alt0) 45,4(Alt0) 53,5(Alt1)
  8.  
  9. N.B.:
  10. 1) Pin 18 is the only one available on all platforms, and
  11. it is the one used by the I2S audio interface.
  12. Pins 12 and 13 might be better choices on an A+, B+ or Pi2.
  13. 2) The onboard analogue audio output uses both PWM channels.
  14. 3) So be careful mixing audio and PWM.
  15.  
  16.  
  17. TODO: Move to separate overlay, this one is predefined by raspberrypi-linux
  18. */
  19.  
  20. /
  21.  
  22.  
  23. {
  24. compatible = "brcm,bcm2835";
  25.  
  26. fragment@0 {
  27. target = <&gpio>;
  28. __overlay__ {
  29. pwm_pins: pwm_pins {
  30. brcm,pins = <18>;
  31. brcm,function = <2>; /* Alt5 */
  32. };
  33. };
  34. };
  35.  
  36. fragment@1 {
  37. target = <&pwm>;
  38. frag1: __overlay__ {
  39. pinctrl-names = "default";
  40. pinctrl-0 = <&pwm_pins>;
  41. assigned-clock-rates = <100000000>;
  42. status = "okay";
  43. };
  44. };
  45.  
  46. fragment@2 {
  47. target-path="/";
  48. __overlay__ {
  49. hatch2sr {
  50. compatible = "hatch2sr";
  51.  
  52. pwm-names = "motor1";
  53. pwms = <&pwm 0 1000000>;
  54. gpios = <&gpio 24 1>, // 0 -> GPIIO_ACTIVE_HIGH, 1 -> GPIO_ACTIVE_LOW
  55. <&gpio 23 1>;
  56.  
  57. };
  58. };
  59. };
  60.  
  61. __overrides__ {
  62. pin = <&pwm_pins>,"brcm,pins:0";
  63. func = <&pwm_pins>,"brcm,function:0";
  64. clock = <&frag1>,"assigned-clock-rates:0";
  65. };
  66. };
Advertisement
Add Comment
Please, Sign In to add comment