Hi all,
I am interfacing with a CAN Controller (MCP25625) that sets an Interrupt pin when data is ready (active low). That pin is then connected to a GPIO on the nRF9160. I want to configure an interrupt on the nRF9160 that calls a SPI read function when the corresponding pin on the nRF9160 goes low. It looks like there's a few ways I can do this, but I want to make sure I am on the right track.
1. I am seeing examples that use a gpio_callback struct and function to act as the interrupt handler, is that correct?
2. I see another function called gpio_pin_interrupt_configure that looks to configure a GPIO for an interrupt.
My questions are:
Are ways 1 and 2 the same way to do this, or does 2 also require a callback?
I am still getting used to Zephyr, which handles the interrupts, but on other ARM devices I would normally create an interrupt service routine where the NVIC is configured. Is this how it is done with Zephyr as well? If so, where can I find these startup files that have all the IRQs for Zephyr?
All I really want to do is configure the GPIO pin for falling edge, and make an ISR that performs a SPI read when this interrupt is triggered. Since I'm not using a button or anything, what would be the first argument to gpio_pin_interrupt_configure()? The docs say it's a struct device *port, but what device am I binding when I create this struct if it's just Pin 5 on the nRF?
Thanks for the assistance.
Sincerely,
Kyle Garland