cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

Contributor II

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

0 Likes
Reply
1 Solution
Moderator
Moderator

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.

View solution in original post

1 Reply
Moderator
Moderator

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.

View solution in original post