You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
758 B
24 lines
758 B
#include "board_button.h"
|
|
|
|
#include "app_button.h"
|
|
#include "board.h"
|
|
#include "znordic.h"
|
|
|
|
#define BUTTON_DETECTION_DELAY APP_TIMER_TICKS(50)
|
|
static board_button_cb_t m_cb;
|
|
//
|
|
void button_process_handler(uint8_t pin_no, uint8_t button_action) {}
|
|
|
|
static app_button_cfg_t buttons[] = {
|
|
{BUTTON_PIN, false, NRF_GPIO_PIN_PULLUP, button_process_handler},
|
|
};
|
|
void BoardButton_Init(board_button_cb_t cb) { //
|
|
ZASSERT(app_button_init(buttons, ARRAY_SIZE(buttons), BUTTON_DETECTION_DELAY));
|
|
}
|
|
void BoardButton_load() { ZASSERT(app_button_enable()); }
|
|
void BoardButton_unload() { ZASSERT(app_button_disable()); }
|
|
|
|
void BoardButton_enable_sense() {
|
|
app_button_disable();
|
|
nrf_gpio_cfg_sense_input(BUTTON_PIN, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
|
|
}
|