Other Parts Discussed in Thread: SYSCONFIG
SDK version: 8.5.0.24
CCS version: 12.2.0.00009
SysConfig version: 1.15.0
I am currently working on a project that requires interrupts to be registered on eight separate GPIO pins. I attempted to modify the SDK example gpio_input_interrupt_am243x-lp_r5fss0-0_nortos_ti-arm-clang to use the GPIO pins GPIO1_[0..6] as well as pin GPIO1_8 by constructing a separate HwiP_Object
instance for each pin. The HwiP_Params.args
field was set up to hand the ISR the respective pin number, in the exact same way as done in the example.
However, I found that every time the ISR was called, args had the value of the final pin number for which the interrupt was registered - meaning that if pin GPIO1_0 was the final pin to be registered, the ISR would always be passed 0, and if GPIO1_8 was the final pin, the ISR would always be passed 8.
After scouring through the SDK documentation I came to believe that this had to do with the interrupt router, and that if I could assign a separate interrupt router output index to each pin, it would be possible to specify the ISR arguments and/or callback individually. I managed to modify the SYSFW resource management mappings - partially through trial and error as the SDK docs seem to be incomplete in this regard. Unfortunately, this has not resolved my issue.
I am under the impression that I was partially correct - the interrupt router outputs do allow one to specify separate interrupt parameters, but only on the bank level. Individual GPIO pins will always be handed the ISR parameters that have been registered for their bank. This is in line with the fact that the tisci_msg_rm_irq_set_req.src_index
field of the structure passed to Sciclient_rmIrqSet()
only seems to care about the GPIO bank index, not the pin number, as can be seen in the example code:
// ti_drivers_config.c, line 92, auto-generated by SysConfig rmIrqReq.src_index = TISCI_BANK_SRC_IDX_BASE_GPIO1 + GPIO_GET_BANK_INDEX(54);
Question 1: Is this the case? If not please correct me.
Question 2: If this is the case, what is the best method for finding out which pin an interrupt was triggered on inside the ISR? It seems that this can be done based on bank (at least in my case, where all pins reside in bank 0), by calling GPIO_getBankIntrStatus()
inside the ISR and checking which bits are 1. I am unsure whether this method is sufficiently reliable.
Thank you very much for your time!