Definitions of API for controlling buttons of an EV3 intelligent brick. More...
Enumerations | |
enum | button_t { LEFT_BUTTON = 0, RIGHT_BUTTON = 1, UP_BUTTON = 2, DOWN_BUTTON = 3, ENTER_BUTTON = 4, BACK_BUTTON = 5, TNUM_BUTTON = 6 } |
Enumeration type for buttons. More... | |
Functions | |
bool_t | ev3_button_is_pressed (button_t button) |
Get the pressed state of the button. More... | |
ER | ev3_button_set_on_clicked (button_t button, ISR handler, intptr_t exinf) |
Attach a click event handler for a button. More... | |
Definitions of API for controlling buttons of an EV3 intelligent brick.
enum button_t |
bool_t ev3_button_is_pressed | ( | button_t | button | ) |
Get the pressed state of the button.
When an invalid button number is specified , always returns false [TODO: check - error log is output].
button | Button number |
true | Pressed state |
false | Unpressed state |
ER ev3_button_set_on_clicked | ( | button_t | button, |
ISR | handler, | ||
intptr_t | exinf | ||
) |
Attach a click event handler for a button.
[TODO: sync with jp version]
The button handler executes in the task contest. The default is called from the wait disabled state.
button | the button to be set |
handler | the handler to be attached, NULL for clearing the current handler |
exinf | extra information passed to the handler when it is called |
E_OK | Successful completion |
E_ID | Invalid button number |