>service routine to trigger on the gpio rising or falling. How to do it depends on the speed needed. If this is broadly possible, what are the best libraries etc to do this from C or C++ ? The rest of the code, which can sleep most of the time can then periodically do something with the count values. All the function that is called in response to the state change needs to do is increment a counter. In effect I want a function in the application to be able to be called like an interrupt service routine when the GPIO pin changes state. I don't think there will be more than a few pulses per second, and each pulse will be long enough to be visible to the naked eye if routed to an LED. Ideally I want to avoid polling the GPIO pin because the pulse could be short and might be missed. JohnBeardmore wrote:Without using any expansion cards, is it possible for a users C / C++ program to get a function called when a GPIO pin changes state ? (Is this what would be known as a 'call back' function ?)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |