-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKeypad.h
104 lines (92 loc) · 2.94 KB
/
Keypad.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
////////////////////////////////////////////////////////////////////////////////////////////////////
// file: C:\Users\Mohammad\Desktop\AVRCLibrary\AVRCLibrary\Keypad.h
//
// summary: Declares the keypad class
////////////////////////////////////////////////////////////////////////////////////////////////////
/*
* Keypad.h
*
*
* |_______Avr 4x4 Keypad Library_______|
*
*
*
*
* Created: 2020-08-21 07:39:08
*
* Filename: keypad.c
* Controller: Atmega8/16/32/128
* Oscillator: 1 MHz
* Author: XploreLabz
* website: www.xplorelabz.com
* Reference:Atmega32 dataSheet
*
* Note:
*
* Rows are connected to lower 4-bits of PORTC
* Cols are connected to higher 4-bits of PORTC
*
*/
#ifndef KEYPAD_H_
#define KEYPAD_H_
/*
*
* Description : This function the rows and colums for keypad scan
* ROW lines are configured as Output.
* Column Lines are configured as Input.
* I/P Arguments:none
* Return value : none
*
*/
void KEYPAD_Init ( ) ;
/*
*
* Description : This function waits till the previous key is released.
* All the ROW lines are pulled low.
* Column Lines are read to check the key press.
* If all the Keys are released then Column lines will remain high(0x0f)
* I/P Arguments:none
* Return value : none
*
*/
void KEYPAD_WaitForKeyRelease ( ) ;
/*
*
* Description : This function waits till a new key is pressed.
* All the ROW lines are pulled low.
* Column Lines are read to check the key press.
* If any Key is pressed then corresponding Column Line goes low.
* Wait for Some time and perform the above operation to ensure the True Key Press before decoding the KEY.
* I/P Arguments:none
* Return value : none
*
*/
void KEYPAD_WaitForKeyPress ( ) ;
/*
*
* Description :This function scans all the rows to decode the key pressed.
* Each time a ROW line is pulled low to detect the KEY.
* Column Lines are read to check the key press.
* If any Key is pressed then corresponding Column Line goes low.
* Return the ScanCode(Combination of ROW & COL) for decoding the key.
* I/P Arguments:none
* Return value : char--> Scancode of the Key Pressed
*
*/
unsigned char KEYPAD_ScanKey ( ) ;
/*
*
* Description:This function waits till a key is pressed and returns its ASCII Value
* Wait till the previous key is released..
* Wait for the new key press.
* Scan all the rows one at a time for the pressed key.
* Decode the key pressed depending on ROW-COL combination and returns its ASCII value.
* I/P Arguments: none
* Return value : char--> ASCII value of the Key Pressed
*
*/
unsigned char KEYPAD_GetKey ( ) ;
#endif /* KEYPAD_H_ */
////////////////////////////////////////////////////////////////////////////////////////////////////
// End of C:\Users\Mohammad\Desktop\AVRCLibrary\AVRCLibrary\Keypad.h
////////////////////////////////////////////////////////////////////////////////////////////////////