31 #include "lib/sensors.h"
32 #include "dev/hwconf.h"
33 #include "dev/button-sensor.h"
34 #include "isr_compat.h"
38 static struct timer debouncetimer;
39 static int status(
int type);
41 HWCONF_PIN(BUTTON, 2, 7);
42 HWCONF_IRQ(BUTTON, 2, 7);
47 ENERGEST_ON(ENERGEST_TYPE_IRQ);
55 ENERGEST_OFF(ENERGEST_TYPE_IRQ);
65 configure(
int type,
int value)
67 if(type == SENSORS_ACTIVE) {
73 if(!status(SENSORS_ACTIVE)) {
75 BUTTON_IRQ_EDGE_SELECTD();
94 return BUTTON_IRQ_ENABLED();
101 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.