Manage external interrupt in FX3

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 Hi all,

   

Does anybody know how to manage an interrupt produced by GPIF machine into ARM?.

   

Thanks in advance,

   

Israel

0 Likes
6 Replies
Anonymous
Not applicable

Could you please elloborate little bit more on your application requirement.

   

Thanks,

   

sai krishna.

0 Likes
Anonymous
Not applicable

 Hi Khrisna,

   

We are using FX3 to develop a USB camera. At the end of every frame we send an interruption from GPIF to ARM to perform some tasks.

   

I found the solution using     CyU3PGpifRegisterCallback (&cbFunction); and CYU3P_GPIF_EVT_SM_INTERRUPT event.

   

Regards,

   

Israel

0 Likes
Anonymous
Not applicable

Are you referring to the FW_TRIG GPIF action?

0 Likes
Anonymous
Not applicable

Jake,

   

I think it is INTR_CPU action.

0 Likes
Anonymous
Not applicable

 Yes, INTR_CPU action.

   

Regards,

   

Israel

0 Likes
Anonymous
Not applicable

 hi every body

   

how to reduce latency between GPIO interrupt  trigger and  start of reading  data from GPIF using CyU3PGpifReadDataWords function 

   

the actual latency that I have is 14 us  and its very long !!!!

   

 

   

 

   

my callback function is 

   

void CyFxGpioIntrCb (

   

        uint8_t gpioId /* Indicates the pin that triggered the interrupt */

   

        )

   

{

   

    CyBool_t gpioValue = CyFalse;

   

    CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

   

    uint8_t data;

   

    /* Get the status of the pin */

   

    apiRetStatus = CyU3PGpioGetValue (gpioId, &gpioValue);

   

    if (apiRetStatus == CY_U3P_SUCCESS)

   

    {

   

        /* Check status of the pin */

   

        if (gpioValue == CyTrue)

   

        {

   

 

   

            /* Set GPIO high event */

   

            CyU3PEventSet(&glFxGpioAppEvent, CY_FX_GPIOAPP_GPIO_HIGH_EVENT,

   

                    CYU3P_EVENT_OR);

   

        }

   

        else

   

        { GPIF_ReadByte(&data, 0xDD);

   

            /* Set GPIO low Event */

   

            CyU3PEventSet(&glFxGpioAppEvent, CY_FX_GPIOAPP_GPIO_LOW_EVENT,

   

                    CYU3P_EVENT_OR);

   

        }

   

    }

   

}

   

 

   

 

   

 

   

where  GPIF_ReadByte is 

   

 

   

CyU3PReturnStatus_t GPIF_ReadByte(uint8_t *buffer, uint8_t Address)

   

{

   

CyU3PReturnStatus_t apiRetStatus = CY_U3P_ERROR_FAILURE;

   

uint32_t word;

   

uint8_t state = 100;

   

int32_t Try_Counter;

   

 

   

 

   

if(GPIF_Busy_Flag)

   

{

   

/* the GPIF interface is reserved */

   

return CY_U3P_ERROR_DEVICE_BUSY;

   

}

   

/* reserve the GPIF interface */

   

GPIF_Busy_Flag=CyTrue;

   

 

   

Try_Counter = 10000;

   

do

   

{

   

apiRetStatus = CyU3PGpifGetSMState(&state);

   

Try_Counter--;

   

}while(((apiRetStatus != CY_U3P_SUCCESS) || (state != WAIT1)) && (Try_Counter));

   

 

   

if((apiRetStatus == CY_U3P_SUCCESS) && (state == WAIT1))

   

{

   

/* set the address bus */

   

CyU3PGpifInitAddrCounter((uint32_t)Address,CyFalse,CyFalse,CyFalse,0);

   

CyU3PGpifControlSWInput (CyTrue);

   

/* extract data from the data bus */

   

Try_Counter = 1000;

   

do{

   

apiRetStatus = CyU3PGpifReadDataWords (0,CyFalse, 1, &word, CYU3P_NO_WAIT);

   

}while((apiRetStatus != CY_U3P_SUCCESS) && (Try_Counter));

   

CyU3PGpifControlSWInput (CyFalse);

   

*buffer = (unsigned char)word;

   

 

   

/* free the GPIF interface */

   

GPIF_Busy_Flag=CyFalse;

   

return(apiRetStatus);

   

}

   

/* free the GPIF interface */

   

GPIF_Busy_Flag=CyFalse;

   

return CY_U3P_ERROR_DEVICE_BUSY;

   

}

0 Likes