Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/bdk/utils/btn.h
1476 views
1
/*
2
* Copyright (c) 2018 naehrwert
3
* Copyright (c) 2018-2022 CTCaer
4
*
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms and conditions of the GNU General Public License,
7
* version 2, as published by the Free Software Foundation.
8
*
9
* This program is distributed in the hope it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef _BTN_H_
19
#define _BTN_H_
20
21
#include <utils/types.h>
22
23
#define BTN_POWER BIT(0)
24
#define BTN_VOL_DOWN BIT(1)
25
#define BTN_VOL_UP BIT(2)
26
#define BTN_HOME BIT(3)
27
#define BTN_SINGLE BIT(7)
28
29
u8 btn_read();
30
u8 btn_read_vol();
31
u8 btn_read_home();
32
u8 btn_wait();
33
u8 btn_wait_timeout(u32 time_ms, u8 mask);
34
u8 btn_wait_timeout_single(u32 time_ms, u8 mask);
35
36
#endif
37
38