Project

General

Profile

Statistics
| Branch: | Revision:

pse-2015-16-grupo-3 / tpf / io.h @ e433afbc

History | View | Annotate | Download (2.84 KB)

1
/* 
2
 * File:   io.h
3
 * Author: gustavobica
4
 *
5
 * Created on 02 November 2015, 16:49
6
 */
7

    
8

    
9

    
10
/*
11
* Deals with the input from the microwave (buttons,switches,etc) and also deals with the output (leds) 
12
*
13
*/
14

    
15

    
16

    
17
#define IN 1
18
#define OUT 0
19

    
20

    
21
#ifndef IO_H
22
#define        IO_H
23

    
24

    
25

    
26

    
27
#ifdef        __cplusplus
28
extern "C" {
29
#endif
30

    
31

    
32

    
33

    
34
#ifdef        __cplusplus
35
}
36
#endif
37

    
38
#endif        /* IO_H */
39

    
40

    
41
/*  
42
 *  \brief Turns the light on inside of the microwave on 
43
 *  \param no need to pass parameters, if successful returns 0, if not returns 1
44
 */
45
uint8_t turnOnLight();
46
/*  
47
 *  \brief Turns the light off inside of the microwave on 
48
 *  \param no need to pass parameters, if successful returns 0, if not returns 1
49
 */
50
uint8_t turnOffLight();
51
/*  
52
 *  \brief Checks if the microwave door is open 
53
 *  \param the pointer to the variable used for the check  , if successful returns 0, if not returns 1
54
 */
55
uint8_t IsDoorOpen(uint8_t* state );
56

    
57

    
58
/*  
59
 *  \brief Turns the megatron on  
60
 *  \param no need to pass parameters, if successful returns 0, if not returns 1
61
 */
62
uint8_t turnOffMegatron();
63
 
64
/*  
65
 *  \brief Turns the megatron off  
66
 *  \param no need to pass parameters, if successful returns 0, if not returns 1
67
 */ 
68
uint8_t turnOnMegatron();
69
 
70
/*  
71
 *  \brief Turns the power on  
72
 *  \param the pointer to the variable used for the check  , if successful returns 0, if not returns 1
73
 */  
74
uint8_t turnOnPower(uint8_t* state);
75

    
76

    
77

    
78
/*  
79
 *  \brief Turns the power off  
80
 *  \param the pointer to the variable used for the check  , if successful returns 0, if not returns 1
81
 */ 
82
uint8_t turnOffPower(uint8_t* state);
83

    
84
/*  
85
 *  \brief Checks if the microwave button for power is pressed 
86
 *  \param the pointer to the variable used for the check  , if successful returns 0, if not returns 1
87
 */
88
uint8_t getONOFFSwitch(uint8_t* state);
89

    
90

    
91
/*  
92
 *  \brief Checks if the microwave maximum temperature was reached  
93
 *  \param the pointer to the variable used for the check  , if successful returns 0, if not returns 1
94
 */
95
uint8_t getTemperatureSwitch(uint8_t* state);
96

    
97

    
98
/*  
99
 *  \brief Checks if the microwave maximum temperature was reached  
100
 *  \param the pointer to the variable used for the check  , if successful returns 0, if not returns 1
101
 */
102
uint8_t getTemperatureSwitch(uint8_t* state);
103

    
104
/*  
105
 *  \brief Checks if the microwave plus button is pressed  
106
 *  \param the pointer to the variable used for the check  , if successful returns 0, if not returns 1
107
 */
108
uint8_t getPlusButton(uint8_t* state);
109

    
110

    
111
/*  
112
 *  \brief Checks if the microwave minus button is pressed  
113
 *  \param the pointer to the variable used for the check  , if successful returns 0, if not returns 1
114
 */
115
uint8_t getMinusButton(uint8_t* state);
116

    
117
/*  
118
 *  \brief Checks if the microwave start/stop button is pressed  
119
 *  \param the pointer to the variable used for the check  , if successful returns 0, if not returns 1
120
 */
121
uint8_t getStartStop(uint8_t* state);
122
    
123