This is the latest (main) BeagleBoard documentation. If you are looking for stable releases, use the drop-down menu on the bottom-left and select the desired version.

Function rc_button_init

Function Documentation

int rc_button_init(int chip, int pin, char polarity, int debounce_us)

Initializes a single button handler.

Parameters
  • chip[in] The gpio chip

  • pin[in] The gpio pin for that chip

  • polarity[in] RC_BTN_POLARITY_NORM_HIGH if using with a pullup resistor, use this for the BeagleBone Blue and Robotics Cape MODE and PAUSE buttons. Alternatively use RC_BTN_POLARITY_NORM_LOW if you are using your own button on another pin set up with a pulldown resistor.

  • debounce_us[in] debounce interval in microseconds. Set to 0 for no debounce. Usually should set to RC_BTN_DEBOUNCE_DEFAULT_US.

Returns

0 on success, -1 on failure