33 #include "lib/sensors.h"
34 #include "dev/hwconf.h"
35 #include "dev/button-sensor.h"
36 #include "isr_compat.h"
40 static struct timer debouncetimer;
41 static int status(
int type);
43 HWCONF_PIN(BUTTON, 2, 7);
44 HWCONF_IRQ(BUTTON, 2, 7);
49 ENERGEST_ON(ENERGEST_TYPE_IRQ);
51 if(BUTTON_CHECK_IRQ()) {
59 ENERGEST_OFF(ENERGEST_TYPE_IRQ);
69 configure(
int type,
int c)
74 if(!status(SENSORS_ACTIVE)) {
76 BUTTON_IRQ_EDGE_SELECTD();
97 return BUTTON_IRQ_ENABLED();
103 value, configure, status);
void timer_set(struct timer *t, clock_time_t interval)
Set a timer.
const struct sensors_sensor button_sensor
Copyright (c) 2014, Analog Devices, Inc.
#define CLOCK_SECOND
A second, measured in system clock time.
static int value(int type, nrf_drv_gpiote_pin_t pin)
Return current state of a button.
int timer_expired(struct timer *t)
Check if a timer has expired.