-
Notifications
You must be signed in to change notification settings - Fork 2
/
Controls.h
156 lines (143 loc) · 4.38 KB
/
Controls.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#ifndef CONTROLS_H_INCLUDED
#define CONTROLS_H_INCLUDED
#include "MCAL_PIC18F.h"
#include "stdtypes.h"
#define ON 1
#define OFF 0
#define No_Read 11
#define KeyPort PORTb
#define SEG_Port PORTd //all port
#define SEG_EnPort PORTa //RA2 ..5
#define SEG01_En 3 //RA2 ..5
#define SEG02_En 4 //RA2 ..5
#define SEG03_En 5 //RA2 ..5
#define SEG04_En 7 //RA2 ..5
#define RB6 6
#define RB5 5
#define columnPort PORTb // RB0..2
#define rowPort PORTd //RD0..3
#define DoorPort PORTb
#define DoorPin 6
#define CancelButPort PORTb
#define CancelPin 5
#define MotorPort PORTc
#define MOTORPin 2
#define LampPort PORTb
#define LampPin 3
#define HeaterPort PORTb
#define HeaterPin 4
#define columnPort PORTb
#define rowPort PORTd
#define COL_INIT 0
#define COL_FIN 3
#define ROW_INIT 0
#define ROW_FIN 4
#define NOT_PRESSED 0x0C
#define StartPressed 0x0B
#define WeightPressed 0x0A
//keypad to enter time
//fan as a motor
//puch buttons to start
// (default 30 seconds from weight sensor & door closed)
//motor & Lamp & heater & time decrease
//cancel button
// (interrupt,cancel heating or time)
//weight sensor as puch button
//empty pin as heater
//7Seg Display to show time
//sensors
//naming u8 MOD_GetValue(...)
void Cont_Init (void);
void Cont_Flash_SEG(u8_t* _tim_,u8_t cnt);
u8_t Cont_read_keypad(u8_t* Keypad_counter);
void Cont_SEGInit(void);
void Cont_Motor(u8_t mode);
void Cont_Lamp(u8_t mode);
/*u8_t Cont_Heater(u8_t mode)
Description: gives signal to the timer to start decreasing
Input Value: inputed time as integer value
Return Value: current time (optional) or void*/
void Cont_Heater(u8_t mode);
/*Description: initializes the keypad ports and pins on start up or any read since the pins is multiplexed with 7SEG
Input Value: void
Return Value: void*/
void Keypad_init (void);
/* Description: Interface to get the ID of the pressed key, return 12 no key
is pressed, this function doesn't handle if 2 keys are
pressed at the same time
Input Value: Nothing
Return Value: pressed key as hexadecimal*/
u8_t Keypad_read (void);
/*Description: initializes the SEG with 00:00 on start up
Input Value: selected pin mode which is port D from the simulator
Return Value: void*/
void SEG_init (u8_t pin ,u8_t contport ,u8_t contpin);
/*u8_t SEG_change_time (u8_t ktime)
Description: shows the inputed time setting & then change time count value
Input Value: inputed time as integer value
Return Value: current time (optional) or void*/
void SEG_GetValues(u8_t t);
void SEG_SetValues(u8_t* t);
void SEG_toogle (u8_t id);
void SEG_ToogleVal (u8_t id ,u8_t val);
#endif // CONTROLS_H_INCLUDED
/*
u8_t Cont_read_keypad(void)
Description: gives signal to the timer to start decreasing
Input Value: inputed time as integer value
Return Value: current time (optional) or void
*/
/*
u8_t Cont_read_startbut(void)
Description: gives signal to the timer to start decreasing
Input Value: inputed time as integer value
Return Value: current time (optional) or void
*/
/*
u8_t Cont_read_cancelbut(void)
Description: gives signal to the timer to start decreasing
Input Value: inputed time as integer value
Return Value: current time (optional) or void
*/
/*
u8_t Cont_motor(u8_t mode)
Description: gives signal to the timer to start decreasing
Input Value: inputed time as integer value
Return Value: current time (optional) or void
*/
/*
u8_t Cont_Lamp(u8_t mode)
Description: gives signal to the timer to start decreasing
Input Value: inputed time as integer value
Return Value: current time (optional) or void
*/
/*
u8_t Cont_Heater(u8_t mode)
Description: gives signal to the timer to start decreasing
Input Value: inputed time as integer value
Return Value: current time (optional) or void
*/
/*
Void 7SEG_init (u8_t pin)
Description: initializes the 7SEG with 00:00 on start up
Input Value: selected pin mode
Return Value: void
*/
/*
u8_t 7SEG_change_time (u8_t ktime)
Description: shows the inputed time setting & then change time count value
Input Value: inputed time as integer value
Return Value: current time (optional) or void
*/
/*
u8_t 7SEG_start_count (void)
Description: gives signal to the timer to start decreasing
Input Value: inputed time as integer value
Return Value: current time (optional) or void
*/
/*
void 7SEG_cancel(void)
Description: shows 00:00
Input Value: void
Return Value: void
*/