Synopsis
int platform_read_button(int index);
Description

platform_read_button reads the platform button with index index, returning 1 when the button is pressed and 0 when released.

platform_read_button takes care of initializing the GPIO pin and handing buttons connected with both positive and negative logic. If the button's GPIO cannot be claimed, the button is not and 0

Return Value

platform_read_button returns 1 when the button is pressed and 0 when the button is released.

Note

A button doesn't need to be directly attached to a GPIO, but this is the typical configuration.

See Also

platform_hook_button_press