40 #include "sys/clock.h"
42 #include "lib/sensors.h"
51 static struct timer debouncetimer;
53 #define REED_IO_CFG (IOC_CURRENT_2MA | IOC_STRENGTH_AUTO | \
54 IOC_IOPULL_DOWN | IOC_SLEW_DISABLE | \
55 IOC_HYST_DISABLE | IOC_BOTH_EDGES | \
56 IOC_INT_DISABLE | IOC_IOMODE_NORMAL | \
57 IOC_NO_WAKE_UP | IOC_INPUT_ENABLE)
66 ENERGEST_OFF(ENERGEST_TYPE_IRQ);
70 sensors_changed(&reed_relay_sensor);
77 return (
int)ti_lib_gpio_pin_read(1 << BOARD_IOID_REED_RELAY);
93 ti_lib_ioc_int_disable(BOARD_IOID_REED_RELAY);
94 ti_lib_gpio_event_clear(1 << BOARD_IOID_REED_RELAY);
97 ti_lib_prcm_peripheral_run_enable(PRCM_PERIPH_GPIO);
100 ti_lib_ioc_port_configure_set(BOARD_IOID_REED_RELAY, IOC_PORT_GPIO,
108 ti_lib_ioc_int_enable(BOARD_IOID_REED_RELAY);
110 ti_lib_ioc_int_disable(BOARD_IOID_REED_RELAY);
130 return (ti_lib_ioc_port_configure_get(BOARD_IOID_REED_RELAY)
131 & IOC_INT_ENABLE) == IOC_INT_ENABLE;
Header file with macros which rename TI CC26xxware functions.
Timer library header file.
void timer_set(struct timer *t, clock_time_t interval)
Set a timer.
Header file for the Sensortag-CC26XX Reed Relay.
Header file for the CC13xx/CC26xx GPIO interrupt management.
static int configure(int type, int value)
Configuration function for the button sensor for all buttons.
#define CLOCK_SECOND
A second, measured in system clock time.
void gpio_interrupt_register_handler(uint8_t ioid, gpio_interrupt_handler_t f)
Register a GPIO interrupt handler.
static int status(int type)
Status function for the reed.
int timer_expired(struct timer *t)
Check if a timer has expired.
static void reed_interrupt_handler(uint8_t ioid)
Handler for Sensortag-CC26XX reed interrupts.