Repository navigation
Expand file tree
/
Copy pathbutton.h
More file actions
60 lines (47 loc) · 1.77 KB
/
Copy pathbutton.h
File metadata and controls
60 lines (47 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Copyright (C) 2006, Joe Lake, monome.org
*
* This file is part of 40h.
*
* 40h is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 40h is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with 40h; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* $Id: button.h,v. 1.1.1.1 2006/05/02 1:01:22
*/
#ifndef __BUTTON_H__
#define __BUTTON_H__
#include "types.h"
#define kButtonEventQueueSize 16
#define kButtonStateDown 1
#define kButtonStateUp 0
#define kButtonDownEvent 1
#define kButtonUpEvent 0
#define kButtonDownDefaultDebounceCount 1
#define kButtonUpDefaultDebounceCount 12
#define kButtonNewEvent 1
#define kButtonNoEvent 0
#ifdef __cplusplus
extern "C"
{
#endif
extern uint8 button_current[8], // bitmap of physical button state (depressed or released)
button_last[8], // bitmap of physical button state last time buttons were read
button_state[8], // bitmap of debounced button state
button_debounce_count[8][8], // debounce counters for each button
button_event[8]; // queued button events (kButtonDownEvent or kButtonDownEvent)
void buttonInit(void);
void buttonCheck(uint8 row, uint8 index);
#ifdef __cplusplus
}
#endif
#endif