AnsweredAssumed Answered

How to write my own low-level pin interrupt handler (BF70x, CCES 2.7.0)

Question asked by Magicbean on Mar 14, 2018
Latest reply on Mar 28, 2018 by Magicbean

I have an BF706 running a real-time-operating system and want to use pin interrupts to signal a change that the OS can respond to.

 

I have implemented a callback function which works reliably using the examples provided by the GPIO driver, installed like this:

adi_gpio_RegisterCallback (ADI_GPIO_PIN_INTERRUPT_3, ADI_GPIO_PIN_1, gpioCallback, (void*)0);

The callback is defined like this:

void gpioCallback(ADI_GPIO_PIN_INTERRUPT ePinInt, uint32_t PinIntData,  void *pCBParam)

... callback code ... }

So far so good.

 

The OS supplier allows the posting of a semaphore etc. from an interrupt routine provided that it is based on the following method:

 

MyISR:      // void MyISR (void)

   CALL   _save_thread_context;

   ... do my interrupt handler stuff ...

   JUMP _restore_thread_context;

 

So I think I need to write a lower level interrupt handler instead of using the GPIO driver callback method. I can't save the thread context from the GPIO driver callback because the threat context is lost by the time it gets there.

 

With BF50x and VisualDSP we had a simple macro do help define the ISR:

EX_INTERRUPT_HANDLER(EVT_IVG11_Entry)
{   ... ISR code ... }

and installed it like this:

register_handler (ik_ivg11, EVT_IVG11_Entry);

 

I am using BF706 and CCES 2.7.0.  I think that the Blackfin+ processors use a System Event Controller always routed through IVG11 but I'm not sure so....

 

My questions are:

Is there a template for a low-level interrupt handler for BF70x and CCES?

How would I install the handler?

Will this allow the rest of my interrupt system to work normally or am I going to disrupt things if I have to subvert the use of IVG11?

 

Thanks.

Outcomes