1 Reply Latest reply on Feb 5, 2015 11:44 AM by ArvindS_76

    gpio_registerForInterrupt

      Please add documentation for thi aPI, especially around the MASK parameter.

       

      void gpio_registerForInterrupt(UINT16 masks[],

                                     void (*userfn)(void*, UINT8),

                                       void* userdata);

        • 1. Re: gpio_registerForInterrupt
          ArvindS_76

          The masks parameter has to be an array of 3 UINT16s, each corresponding to the three ports on the 2073x (port0 which has P0-P15, port1 which has P16-P31 and port2 which has P32-P39). The interrupt handler you register here will be invoked for interrupts that trigger for the bits that are set in the mask parameter.

           

          For instance, if you want handler1 to handle interrupts on P0, P4, P24 and P33:

          UINT16 masks1[3] = {    (1)  | (1 << 4),     (1 << 8),   (1 << 1)  };

          gpio_registerForInterrupt(masks1, handler1, NULL);

           

          And handler2 to handle interrupts on P1 and P4:

          UINT16 masks2[3] = {  (1 << 1) | ( 1<< 4 ), 0, 0 };

          gpio_registerForInterrupt(masks2, handler2, NULL);