Jump to content

Poll both PCA9535 I/O using one interrupt? 


DenisS

Recommended Posts

Hi everybody,

In a project I'm working on, I've added two PCA9535 I/O expanders to use 32 additional inputs on my Nano Pi Neo. 
I've connected the INT line from both multiplexers to the gpio11 interrupt pin on the Nano Pi Neo, and attached to that a pull-up resistor of 10k. 
I've used interrupts before, but my question is how to poll both PCA9535 I/O using one interrupt? 
my DTS when polling one (It works!):

/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";

    fragment@0 {
        /* This fragment is required only if using interrupts */
        target = <&pio>;
        __overlay__ {
            pca9535_pin_irq: pca9535_pin_irq {
                pins = "PA11";
                function = "irq";
                bias-pull-up;
            };
        };
    };

    fragment@1 {
        target = <&i2c1>;
        __overlay__ {
            #address-cells = <1>;
            #size-cells = <0>;
            pca9535@20 {
                compatible = "nxp,pca9535";
                reg = <0x20>;
                status = "okay";
                gpio-controller;
                #gpio-cells = <2>;
                gpio-line-names = "DI1", "DI2", "DI3", "DI4", "DI5", "DI6", "DI7", "DI8", "DI9", "DI10", "DI11", "DI12", "DI13", "DI14", "DI15", "DI16";
                /* Below are optional properties for supporting interrupts */
                interrupt-controller;
                #interrupt-cells = <2>;
                interrupt-parent = <&pio>;
                interrupts = <0 11 2>; /* PA11 IRQ_TYPE_EDGE_FALLING */
                pinctrl-names = "default";
                pinctrl-0 = <&pca9535_pin_irq>;
            };
        };
    };

};


Any chance somebody could help me out? Any help is greatly appreciated!

Thanks a lot, Denis

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines