ruuvi.drivers.c
${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
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
"
19
#include "
ruuvi_interface_gpio.h
"
20
#include "
ruuvi_interface_gpio_interrupt.h
"
21
#include <stdlib.h>
22
28
typedef
void (*
rt_button_fp_t
) (
const
ri_gpio_evt_t
event);
29
31
typedef
struct
32
{
33
const
ri_gpio_id_t
*
p_button_pins
;
34
const
ri_gpio_state_t
*
p_button_active
;
35
const
rt_button_fp_t
*
p_button_handlers
;
36
const
size_t
num_buttons
;
37
}
rt_button_init_t
;
38
60
rd_status_t
rt_button_init
(
const
rt_button_init_t
*
const
rt_init);
61
72
rd_status_t
rt_button_uninit
(
const
rt_button_init_t
*
const
rt_init);
73
75
#endif
rd_status_t
uint32_t rd_status_t
bitfield for representing errors
Definition:
ruuvi_driver_error.h:54
ruuvi_driver_error.h
Ruuvi error codes and error check function.
ruuvi_interface_gpio.h
ri_gpio_id_t
uint16_t ri_gpio_id_t
port<<8 + pin
Definition:
ruuvi_interface_gpio.h:60
ri_gpio_state_t
ri_gpio_state_t
States of GPIO pins.
Definition:
ruuvi_interface_gpio.h:54
ruuvi_interface_gpio_interrupt.h
rt_button_init
rd_status_t rt_button_init(const rt_button_init_t *const rt_init)
Button initialization function.
Definition:
ruuvi_task_button.c:113
rt_button_uninit
rd_status_t rt_button_uninit(const rt_button_init_t *const rt_init)
Button uninitialization function.
Definition:
ruuvi_task_button.c:118
rt_button_fp_t
void(* rt_button_fp_t)(const ri_gpio_evt_t event)
Called on button event with the slope of edge.
Definition:
ruuvi_task_button.h:28
ri_gpio_evt_t
Event from GPIO.
Definition:
ruuvi_interface_gpio_interrupt.h:38
rt_button_init_t
Struct for initializing buttons.
Definition:
ruuvi_task_button.h:32
rt_button_init_t::p_button_active
const ri_gpio_state_t * p_button_active
Array of button active states.
Definition:
ruuvi_task_button.h:34
rt_button_init_t::num_buttons
const size_t num_buttons
Number of buttons to initialize.
Definition:
ruuvi_task_button.h:36
rt_button_init_t::p_button_handlers
const rt_button_fp_t * p_button_handlers
Array of button handlers.
Definition:
ruuvi_task_button.h:35
rt_button_init_t::p_button_pins
const ri_gpio_id_t * p_button_pins
Array of button pins.
Definition:
ruuvi_task_button.h:33
src
tasks
ruuvi_task_button.h
Generated by
1.9.1