-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKBD_interface.h
52 lines (43 loc) · 1.24 KB
/
KBD_interface.h
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
/*******************************************************/
/* Author : Bishoy Medhat */
/* Version : V1.0 */
/* Date : 26 FEB 2019 */
/*******************************************************/
/* Description */
/* ------------ */
/* This file defines the APIs corresponding to Keypad */
/*******************************************************/
/* Comment: Header file guard */
#ifndef KBD_INTERFACE_H
#define KBD_INTERFACE_H
#define KBD_u8_KEYS_NB 16 // KBD_u8_ROWS * KBD_u8_COL
#define KBD_u8_NOT_PRESSED 0
#define KBD_u8_PRESSED 1
#define KBD_u8_ACTIVE_COL 0
#define KBD_u8_ACTIVE_ROW 1
#define KBD_u8_CON_PULLDOWN 0
#define KBD_u8_CON_PULLUP 1
//embedded
#define R1 B7
#define R2 B6
#define R3 B5
#define R4 B4
#define C1 B2
#define C2 B1
#define C3 B0
#define C4 D1
/*
#define R1 A7
#define R2 A6
#define R3 A5
#define R4 A4
#define C1 A3
#define C2 A2
#define C3 A1
#define C4 A0
*/
u8 KBD_u8GetKeyPadState(u8 Copy_Au8KeysState[KBD_u8_KEYS_NB]);
void KBD_u8Initialize(u8 group_nb);
u8 KBD_keys_map(u8* keys);
void KBD_u8Initialize_2(void);
#endif