Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hvac_private.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2014, Freescale Semiconductor, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met:
7 *
8 * o Redistributions of source code must retain the above copyright notice, this list
9 * of conditions and the following disclaimer.
10 *
11 * o Redistributions in binary form must reproduce the above copyright notice, this
12 * list of conditions and the following disclaimer in the documentation and/or
13 * other materials provided with the distribution.
14 *
15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
16 * contributors may be used to endorse or promote products derived from this
17 * software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30 
31 #ifndef __hvac_private_h__
32 #define __hvac_private_h__
33 
35 // Includes
37 
38 #include <stdint.h>
39 #include <stdbool.h>
40 #include <fsl_os_abstraction.h>
41 
43 // Definitions
45 
46 #define HVAC_CONTROL_CYCLE_IN_SECONDS 1
47 
48 #define HVAC_CONTROL_CYCLE_IN_TICKS (HVAC_CONTROL_CYCLE_IN_SECONDS*BSP_ALARM_FREQUENCY)
49 
50 #define HVAC_DEFAULT_TEMP 200 // in 1/10 degree C
51 
52 #define HVAC_PARAMS_CHANGED 1
53 
54 #define ENABLE_ADC 1
55 
56 #define LED_1 1
57 #define LED_2 1
58 #define LED_3 1
59 #define LED_4 1
60 
61 typedef struct {
62  event_flags_t Event;
68 
69 typedef struct {
71  bool FanOn;
74 
75 
76 extern HVAC_STATE HVAC_State;
78 
79 void HVAC_InitializeParameters(void);
80 bool HVAC_InitializeIO(void);
81 void HVAC_ResetOutputs(void);
82 void HVAC_SetOutput(HVAC_Output_t,bool);
83 void HVAC_InitializeADC(void);
84 int32_t ReadADC(void);
85 
86 #endif
uint32_t DesiredTemperature
Definition: hvac_private.h:66
Definition: hvac_private.h:69
struct HVAC_PARAMS * HVAC_PARAMS_PTR
void HVAC_SetOutput(HVAC_Output_t signal, bool state)
Set output.
Definition: hvac_io.c:182
struct HVAC_STATE * HVAC_STATE_PTR
void HVAC_InitializeADC(void)
Setup ADC module to read in accelerometer and potentiometer values.
Definition: hvac_io.c:254
void HVAC_InitializeParameters(void)
Initialize parameters for HVAC.
Definition: hvac_util.c:64
int32_t ReadADC(void)
Read in ADC value on the channel given.
Definition: hvac_io.c:284
Temperature_Scale_t TemperatureScale
Definition: hvac_private.h:65
HVAC_Mode_t
Definition: hvac_public.h:74
void HVAC_ResetOutputs(void)
Reset output.
Definition: hvac_io.c:170
FAN_Mode_t FanMode
Definition: hvac_private.h:64
Definition: hvac_private.h:61
HVAC_STATE HVAC_State
Definition: hvac_task.c:56
event_flags_t Event
Definition: hvac_private.h:62
HVAC_Mode_t HVACMode
Definition: hvac_private.h:63
HVAC_Output_t
Definition: hvac_public.h:56
HVAC_PARAMS HVAC_Params
Definition: hvac_util.c:53
uint32_t ActualTemperature
Definition: hvac_private.h:72
FAN_Mode_t
Definition: hvac_public.h:81
HVAC_Mode_t HVACState
Definition: hvac_private.h:70
Temperature_Scale_t
Definition: hvac_public.h:86
bool HVAC_InitializeIO(void)
Initialize LEDs and SWs for HVAC simulation.
Definition: hvac_io.c:123
bool FanOn
Definition: hvac_private.h:71