diff --git a/raspyrfm.diff b/raspyrfm.diff new file mode 100644 index 0000000..c88329c --- /dev/null +++ b/raspyrfm.diff @@ -0,0 +1,14 @@ +diff --git a/raspyrfm/__init__.py b/raspyrfm/__init__.py +index 3587a64..08d895d 100644 +--- a/raspyrfm/__init__.py ++++ b/raspyrfm/__init__.py +@@ -12,6 +12,9 @@ def __get_hw_params(mod): + dio0 = 1 + elif mod == 4: + dio0 = 18 ++ elif mod == 5: ++ dio0 = 2 ++ mod = 3 # spidev0.2 + else: + return + diff --git a/spi0-3cs-overlay.dts b/spi0-3cs-overlay.dts new file mode 100644 index 0000000..65b0248 --- /dev/null +++ b/spi0-3cs-overlay.dts @@ -0,0 +1,44 @@ +/dts-v1/; +/plugin/; + + +/ { + compatible = "brcm,bcm2835"; + + fragment@0 { + target = <&spi0_cs_pins>; + frag0: __overlay__ { + brcm,pins = <8 7 3>; + }; + }; + + fragment@1 { + target = <&spi0>; + frag1: __overlay__ { + #address-cells = <1>; + #size-cells = <0>; + + cs-gpios = <&gpio 8 1>, <&gpio 7 1>, <&gpio 3 1>; + status = "okay"; + + spidev0_2: spidev@2 { + compatible = "spidev"; + reg = <2>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; + spi-max-frequency = <125000000>; + }; + }; + }; + + __overrides__ { + cs0_pin = <&frag0>,"brcm,pins:0", + <&frag1>,"cs-gpios:4"; + cs1_pin = <&frag0>,"brcm,pins:4", + <&frag1>,"cs-gpios:16"; + cs2_pin = <&frag0>,"brcm,pins:8", + <&frag1>,"cs-gpios:28"; + cs2_spidev = <&spidev0_2>, "status"; + }; +}; + diff --git a/spi0-3cs.dtbo b/spi0-3cs.dtbo new file mode 100644 index 0000000..b1d0008 Binary files /dev/null and b/spi0-3cs.dtbo differ