Logo
TIDM-CAPTIVATE-THERMOSTAT-UI Example Application Guide  v1.00.00.00
Thermostat_UI_LEDs.h
1 /* --COPYRIGHT--,BSD
2  * Copyright (c) 2014, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * --/COPYRIGHT--*/
32 
33 //*****************************************************************************
34 //
35 // Thermostat_UI_LEDs.h
36 //
38 //
41 //
42 //*****************************************************************************
43 
44 //*****************************************************************************
47 //*****************************************************************************
48 
49 #ifndef TIDM_CAPTIVATE_THERMOSTAT_UI_LEDS_H_
50 #define TIDM_CAPTIVATE_THERMOSTAT_UI_LEDS_H_
51 
52 #include <msp430.h>
53 #include "Thermostat_UI_Demo.h"
54 
55 //*****************************************************************************
56 // UP LED defines
57 //*****************************************************************************
58 
61 #define UP_LED_POUT (P2OUT)
62 
65 #define UP_LED_PDIR (P2DIR)
66 
69 #define UP_LED_PIN (BIT0)
70 
73 #define UP_LED_ON (UP_LED_POUT &= ~UP_LED_PIN)
74 
77 #define UP_LED_OFF (UP_LED_POUT |= UP_LED_PIN)
78 
81 #define UP_LED_TOGGLE (UP_LED_POUT ^= UP_LED_PIN)
82 
83 //*****************************************************************************
84 // DOWN LED defines
85 //*****************************************************************************
86 
89 #define DOWN_LED_POUT (P2OUT)
90 
93 #define DOWN_LED_PDIR (P2DIR)
94 
97 #define DOWN_LED_PIN (BIT1)
98 
101 #define DOWN_LED_ON (DOWN_LED_POUT &= ~DOWN_LED_PIN)
102 
105 #define DOWN_LED_OFF (DOWN_LED_POUT |= DOWN_LED_PIN)
106 
109 #define DOWN_LED_TOGGLE (DOWN_LED_POUT ^= DOWN_LED_PIN)
110 
111 //*****************************************************************************
112 // SET LED defines
113 //*****************************************************************************
114 
117 #define SET_LED_POUT (P2OUT)
118 
121 #define SET_LED_PDIR (P2DIR)
122 
125 #define SET_LED_PIN (BIT6)
126 
129 #define SET_LED_ON (SET_LED_POUT &= ~SET_LED_PIN)
130 
133 #define SET_LED_OFF (SET_LED_POUT |= SET_LED_PIN)
134 
137 #define SET_LED_TOGGLE (SET_LED_POUT ^= SET_LED_PIN)
138 
139 //*****************************************************************************
140 // HOLD LED defines
141 //*****************************************************************************
142 
145 #define HOLD_LED_POUT (P1OUT)
146 
149 #define HOLD_LED_PDIR (P1DIR)
150 
153 #define HOLD_LED_PIN (BIT0)
154 
157 #define HOLD_LED_ON (HOLD_LED_POUT &= ~HOLD_LED_PIN)
158 
161 #define HOLD_LED_OFF (HOLD_LED_POUT |= HOLD_LED_PIN)
162 
165 #define HOLD_LED_TOGGLE (HOLD_LED_POUT ^= HOLD_LED_PIN)
166 
167 //*****************************************************************************
168 // FAN AUTO LED defines
169 //*****************************************************************************
170 
173 #define FANAUTO_LED_POUT (P2OUT)
174 
177 #define FANAUTO_LED_PDIR (P2DIR)
178 
181 #define FANAUTO_LED_PIN (BIT5)
182 
185 #define FANAUTO_LED_ON (FANAUTO_LED_POUT &= ~FANAUTO_LED_PIN)
186 
189 #define FANAUTO_LED_OFF (FANAUTO_LED_POUT |= FANAUTO_LED_PIN)
190 
193 #define FANAUTO_LED_TOGGLE (FANAUTO_LED_POUT ^= FANAUTO_LED_PIN)
194 
195 //*****************************************************************************
196 // FAN ON LED defines
197 //*****************************************************************************
198 
201 #define FANON_LED_POUT (P1OUT)
202 
205 #define FANON_LED_PDIR (P1DIR)
206 
209 #define FANON_LED_PIN (BIT7)
210 
213 #define FANON_LED_ON (FANON_LED_POUT &= ~FANON_LED_PIN)
214 
217 #define FANON_LED_OFF (FANON_LED_POUT |= FANON_LED_PIN)
218 
221 #define FANON_LED_TOGGLE (FANON_LED_POUT ^= FANON_LED_PIN)
222 
223 //*****************************************************************************
224 // HEAT LED defines
225 //*****************************************************************************
226 
229 #define HEAT_LED_POUT (P2OUT)
230 
233 #define HEAT_LED_PDIR (P2DIR)
234 
237 #define HEAT_LED_PIN (BIT4)
238 
241 #define HEAT_LED_ON (HEAT_LED_POUT &= ~HEAT_LED_PIN)
242 
245 #define HEAT_LED_OFF (HEAT_LED_POUT |= HEAT_LED_PIN)
246 
249 #define HEAT_LED_TOGGLE (HEAT_LED_POUT ^= HEAT_LED_PIN)
250 
251 //*****************************************************************************
252 // COOL LED defines
253 //*****************************************************************************
254 
257 #define COOL_LED_POUT (P1OUT)
258 
261 #define COOL_LED_PDIR (P1DIR)
262 
265 #define COOL_LED_PIN (BIT6)
266 
269 #define COOL_LED_ON (COOL_LED_POUT &= ~COOL_LED_PIN)
270 
273 #define COOL_LED_OFF (COOL_LED_POUT |= COOL_LED_PIN)
274 
277 #define COOL_LED_TOGGLE (COOL_LED_POUT ^= COOL_LED_PIN)
278 
279 //*****************************************************************************
280 // Function Prototypes
281 //*****************************************************************************
282 
289 extern void LEDs_updateStatus(FanState fanState, UnitState unitState, bool hold);
290 
291 //*****************************************************************************
292 // Close the Doxygen group.
294 //*****************************************************************************
295 
296 #endif /* TIDM_CAPTIVATE_THERMOSTAT_UI_LEDS_H_ */
UnitState
UnitState enumeration contains all valid states for the heating/cooling unit controlled by the thermo...
Definition: Thermostat_UI_Demo.h:79
void LEDs_updateStatus(FanState fanState, UnitState unitState, bool hold)
Updates the state of the button LEDs to match the thermostat state.
Definition: Thermostat_UI_LEDs.c:36
FanState
FanState enumeration contains all valid states for the fan controlled by the thermostat UI...
Definition: Thermostat_UI_Demo.h:70