![]() |
nRF Connect SDK Bare Metal API 2.0.99
|
| int bm_buttons_init | ( | const struct bm_buttons_config * | configs, |
| uint8_t | num_configs, | ||
| uint32_t | detection_delay ) |
#include <bm_buttons.h>
Initialize buttons.
This function will initialize the specified pins as buttons, and configure them.
configs configurations will still be referenced internally by the library. It is the user's responsibility to ensure that the configs configurations remain valid and exist until the end of the program or until bm_buttons_deinit is called. If the configs configurations are altered or destroyed prematurely, it will result in undefined behavior.| [in] | configs | Array of button configurations to be used. |
| [in] | num_configs | Number of button configurations. |
| [in] | detection_delay | Delay (in microseconds) from a GPIOTE event until a button is reported as pressed. Must be higher than BM_BUTTONS_DETECTION_DELAY_MIN_US. |
| 0 | on success. |
| -EPERM | If the bm_buttons library is already initialized. |
| -EINVAL | If input data is invalid. |
| -EIO | If an error occurred. |