1 Reply Latest reply on Mar 28, 2018 4:59 AM by abga

    how to recieve an external interrupt in fx3s?

    Geethanjali_3054931

      The pin from an external device is connected to fx3s pin.How to call an ISR ?specific to this pin?

      or

      fx3 supports an external interrupt pin?

      let me know

       

      thank you

        • 1. Re: how to recieve an external interrupt in fx3s?
          abga

          Yes FX3 supports external interrupt pin. Please refer to the following firmware example code:

          C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples\cyfxgpioapp

           

          In this Firmware refer to the CyFxGpioInit() :

           

          apiRetStatus = CyU3PGpioInit(&gpioClock, CyFxGpioIntrCb); // Here you have to register the callback function. In this case CyFxGpioIntrCb

              if (apiRetStatus != 0)

              {

                  /* Error Handling */

                  CyU3PDebugPrint (4, "CyU3PGpioInit failed, error code = %d\n", apiRetStatus);

                  CyFxAppErrorHandler(apiRetStatus);

              }

           

           

              /* Configure GPIO 45 as input with interrupt enabled for both edges */

              gpioConfig.outValue = CyTrue;

              gpioConfig.inputEn = CyTrue;

              gpioConfig.driveLowEn = CyFalse;

              gpioConfig.driveHighEn = CyFalse;

              gpioConfig.intrMode = CY_U3P_GPIO_INTR_BOTH_EDGE;  // Here you can select type of Interrupt (Level , Edge Triggered)

              apiRetStatus = CyU3PGpioSetSimpleConfig(45, &gpioConfig); // Here GPIO 45 is configured to receive external interrupt

              if (apiRetStatus != CY_U3P_SUCCESS)

              {

                  /* Error handling */

                  CyU3PDebugPrint (4, "CyU3PGpioSetSimpleConfig failed, error code = %d\n",

                          apiRetStatus);

                  CyFxAppErrorHandler(apiRetStatus);

           

          Please refer to the comments that I have mentioned above.

          1 of 1 people found this helpful