A button callback function is called on the interrupt level whenever an event at a button occurs that the function was registered for. The callback function is passed the button id and the type of event that occurred. This way, the same callback function can be registered for different buttons and events.
the type of event that the callback function should be invoked for. event types can be bitwise or'd to register a callback for both pressed and released events.
callback
pointer to the callback function. This function is called from the interrupt handler.
Unregister a callback function for a button event.
Parameters:
btn
the id of the button
eve
the type of event that the callback function should be invoked for. event types can be bitwise or'd to register a callback for both pressed and released events.
callback
pointer to the callback function
Returns:
0 on success, negative value on error
Return values:
0
success
-1
the callback function was not registered with the given button/event combination