Wirepas SDK
button.h
Go to the documentation of this file.
1/* Copyright 2018 Wirepas Ltd. All Rights Reserved.
2 *
3 * See file LICENSE.txt for full license details.
4 *
5 */
6
12#ifndef BUTTON_H_
13#define BUTTON_H_
14
15#include <stdint.h>
16#include <stdbool.h>
17
25
40
48typedef void (*on_button_event_cb)(uint8_t button_id,
49 button_event_e event);
50
54void Button_init(void);
55
67 button_event_e event,
69
79button_res_e Button_getState(uint8_t button_id,
80 bool * state_p);
81
85uint8_t Button_get_number(void);
86
87#endif /* BUTTON_H_ */
button_event_e
Different events for a button.
Definition button.h:21
@ BUTTON_RELEASED
Definition button.h:23
@ BUTTON_PRESSED
Definition button.h:22
void Button_init(void)
Initialize Button module.
button_res_e Button_register_for_event(uint8_t button_id, button_event_e event, on_button_event_cb cb)
Register for a button event.
button_res_e Button_getState(uint8_t button_id, bool *state_p)
Get State of a given button.
void(* on_button_event_cb)(uint8_t button_id, button_event_e event)
Callback structure for a button event.
Definition button.h:48
button_res_e
List of return code.
Definition button.h:30
@ BUTTON_RES_OK
Definition button.h:32
@ BUTTON_RES_INVALID_PARAM
Definition button.h:36
@ BUTTON_RES_UNINITIALIZED
Definition button.h:38
@ BUTTON_RES_INVALID_ID
Definition button.h:34
uint8_t Button_get_number(void)
Get number of buttons.