34#include "lib/simEnvChange.h"
41#define LOG_MODULE "Cooja Button"
42#define LOG_LEVEL LOG_LEVEL_NONE
47char simButtonIsActive = 1;
48const struct simInterface button_interface;
51BUTTON_HAL_BUTTON(button_user,
"User button", COOJA_BTN_PIN,
54BUTTON_HAL_BUTTONS(&button_user);
57doInterfaceActionsBeforeTick(
void)
59 if(simButtonChanged) {
60 LOG_DBG(
"Cooja button changed. simButtonIsDown=%u, ", simButtonIsDown);
67 LOG_DBG_(
"clearing pin");
70 LOG_DBG_(
"setting pin");
79 LOG_DBG_(
", triggering edge event");
89doInterfaceActionsAfterTick(
void)
93SIM_INTERFACE(button_interface,
94 doInterfaceActionsBeforeTick,
95 doInterfaceActionsAfterTick);
101#include "lib/sensors.h"
102#include "dev/button-sensor.h"
111configure(
int type,
int c)
122SENSORS_SENSOR(
button_sensor, BUTTON_SENSOR, value, configure, status);
gpio_hal_pin_cfg_t gpio_hal_arch_no_port_pin_cfg_get(gpio_hal_pin_t pin)
Read the configuration of a GPIO pin.
void gpio_hal_event_handler(gpio_hal_port_t port, gpio_hal_pin_mask_t pins)
The platform-independent GPIO event handler.
void gpio_hal_arch_no_port_clear_pin(gpio_hal_pin_t pin)
Clear a GPIO pin (logical low)
void gpio_hal_arch_no_port_set_pin(gpio_hal_pin_t pin)
Set a GPIO pin to logical high.
#define gpio_hal_pin_to_mask(pin)
Convert a pin to a pin mask.
Header file for the logging system.
SENSORS & button_sensor
Exports global symbols for the sensor API.