#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "contiki.h"
#include "button-sensor.h"
#include "sys/timer.h"
#include "asf.h"
#include "extint.h"
Macros | |
#define | DEBOUNCE_TIME (CLOCK_SECOND/8) |
Functions | |
static int | button_sensor_configure (int type, int value) |
void | button_sensor_init (void) |
static int | button_sensor_status (int type) |
static int | button_sensor_value (int type) |
static void | extint_detection_callback (void) |
SENSORS_SENSOR (button_sensor,"Button sensor", button_sensor_value, button_sensor_configure, button_sensor_status) | |
Variables | |
static struct timer | debouncetimer |
static int | enabled = 0 |
#define DEBOUNCE_TIME (CLOCK_SECOND/8) |
Referenced by extint_detection_callback().
|
static |
References extint_chan_conf::detection_criteria, enabled, extint_chan_get_config_defaults(), extint_chan_set_config(), EXTINT_DETECT_FALLING, EXTINT_DETECT_NONE, EXTINT_PULL_UP, extint_chan_conf::gpio_pin, extint_chan_conf::gpio_pin_mux, and extint_chan_conf::gpio_pin_pull.
Referenced by button_sensor_init().
void button_sensor_init | ( | void | ) |
References button_sensor_configure(), debouncetimer, extint_chan_conf::detection_criteria, port_config::direction, EXTINT_CALLBACK_TYPE_DETECT, extint_chan_enable_callback(), extint_chan_get_config_defaults(), extint_chan_set_config(), EXTINT_DETECT_FALLING, extint_detection_callback(), EXTINT_PULL_UP, extint_register_callback(), extint_chan_conf::gpio_pin, extint_chan_conf::gpio_pin_mux, extint_chan_conf::gpio_pin_pull, port_config::input_pull, port_get_config_defaults(), PORT_PIN_DIR_INPUT, PORT_PIN_PULL_UP, port_pin_set_config(), system_interrupt_enable_global(), and timer_set().
|
static |
References enabled.
|
static |
References port_pin_get_input_level().
|
static |
References button_sensor, DEBOUNCE_TIME, debouncetimer, port_pin_get_input_level(), sensors_changed(), timer_expired(), and timer_set().
Referenced by button_sensor_init().
SENSORS_SENSOR | ( | button_sensor | , |
"Button sensor" | , | ||
button_sensor_value | , | ||
button_sensor_configure | , | ||
button_sensor_status | |||
) |
|
static |
Referenced by button_sensor_init(), and extint_detection_callback().
|
static |
Referenced by button_sensor_configure(), and button_sensor_status().