The_Meter413 0 Posted January 18, 2015 Share Posted January 18, 2015 Total noob question; I'm more or less teaching myself embedded systems with a Tiva C Series Launchpad. I'm using CCS v6 and the TivaWare Peripheral Driver Library (whatever the latest version is from TI). Question on enabling interrupts on a GPIO pin: I see in the API documentation for GPIO that one can enable interrupts on a GPIO pin using the function GPIOIntEnable() which takes the parameters of the port and pin. I also see in the NVIC section of the same doc the function IntEnable(). Do these functions essentially do the same thing? Is it right to assume that the preferred method to enable interrupts on a GPIO pin is with GPIOIntEnable()? What's the use case for the IntEnable() function? Thanks for helping me with my edumacation! Quote Link to post Share on other sites
spirilis 1,265 Posted January 18, 2015 Share Posted January 18, 2015 Nope GPIOIntEnable makes the pin interrupt capable inside the GPIO module, but then IntEnable allows that particular GPIO port's interrupts to actually raise the CPU's interrupt attention. You need both. Quote Link to post Share on other sites
spirilis 1,265 Posted January 18, 2015 Share Posted January 18, 2015 Also be sure to configure the edge used to trigger the pin's interrupt. I don't recall offhand what that is (but it's a great thing for you to study right now :-) ). Should also be sure the pin is configured as Input. Quote Link to post Share on other sites
L.R.A 78 Posted January 18, 2015 Share Posted January 18, 2015 Fun fact:If you do GPIOIntRegister (or other PeripheralIntRegister I belive) it also does // // Enable the GPIO interrupt. // IntEnable(ui32Int);So it actually enables the interruptI always used GPIOIntRegister instead of default handlers and saw other codes using the IntEnable. But I never needed and didn't know why This is why luligar 1 Quote Link to post Share on other sites
spirilis 1,265 Posted January 18, 2015 Share Posted January 18, 2015 Oh! Well that's good to know Quote Link to post Share on other sites
The_Meter413 0 Posted January 19, 2015 Author Share Posted January 19, 2015 Thanks for the confirmation, L.R.A! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.