ruuvi.drivers.c ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
Loading...
Searching...
No Matches
ruuvi_task_button.h
Go to the documentation of this file.
1
15#ifndef RUUVI_TASK_BUTTON_H
16#define RUUVI_TASK_BUTTON_H
17
18#include "ruuvi_driver_error.h"
21#include <stdlib.h>
22
28typedef void (*rt_button_fp_t) (const ri_gpio_evt_t event);
29
38
60rd_status_t rt_button_init (const rt_button_init_t * const rt_init);
61
72rd_status_t rt_button_uninit (const rt_button_init_t * const rt_init);
73
75#endif
uint32_t rd_status_t
bitfield for representing errors
Ruuvi error codes and error check function.
uint16_t ri_gpio_id_t
port<<8 + pin
ri_gpio_state_t
States of GPIO pins.
rd_status_t rt_button_init(const rt_button_init_t *const rt_init)
Button initialization function.
rd_status_t rt_button_uninit(const rt_button_init_t *const rt_init)
Button uninitialization function.
void(* rt_button_fp_t)(const ri_gpio_evt_t event)
Called on button event with the slope of edge.
Struct for initializing buttons.
const ri_gpio_state_t * p_button_active
Array of button active states.
const size_t num_buttons
Number of buttons to initialize.
const rt_button_fp_t * p_button_handlers
Array of button handlers.
const ri_gpio_id_t * p_button_pins
Array of button pins.