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
adc_low_power.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc. *
3  * All rights reserved. *
4  * *
5  * Redistribution and use in source and binary forms, with or without modifi- *
6  * cation, are permitted provided that the following conditions are met: *
7  * *
8  * o Redistributions of source code must retain the above copyright notice, *
9  * this list of conditions and the following disclaimer. *
10  * *
11  * o Redistributions in binary form must reproduce the above copyright notice, *
12  * this list of conditions and the following disclaimer in the documentation *
13  * and/or 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" *
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE *
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE *
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF *
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS *
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN *
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) *
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
29  * POSSIBILITY OF SUCH DAMAGE. *
30  * *
31  *******************************************************************************/
32 
33 
34 #ifndef __LOWPOWER_ADC_H__
35 #define __LOWPOWER_ADC_H__
36 
38 // Includes
40 
41 #include <stdint.h>
42 
44 // Definitions
46 
50 typedef struct lowPowerAdcBoundaries
51 {
52  int32_t upperBoundary;
53  int32_t lowerBoundary;
55 
59 void LowPowerTimerIRQHandler(void);
60 
64 void ADC1IRQHandler(void);
65 
69 void InitLowPowerTmr(void);
70 
76 int32_t GetCurrentTempValue(void);
77 
87 lowPowerAdcBoundaries_t TempSensorCalibration(uint32_t updateBoundariesCounter,
88  int32_t *tempArray);
89 
93 void ADC_TEST_InstallCallback(uint32_t instance, uint32_t chnGroup, void (*callbackFunc)(void) );
94 
98 uint16_t ADC_TEST_GetConvValueRAWInt(uint32_t instance, uint32_t chnGroup);
99 
100 #endif // __LOWPOWER_ADC_H__
lowPowerAdcBoundaries_t TempSensorCalibration(uint32_t updateBoundariesCounter, int32_t *tempArray)
Calculate current temperature.
Definition: demo_apps/adc_low_power/main.c:264
void InitLowPowerTmr(void)
Initialize Low Power Timer. Use 1 kHz LPO with no preescaler and enable LPT interrupt.
uint16_t ADC_TEST_GetConvValueRAWInt(uint32_t instance, uint32_t chnGroup)
User-defined function to read conversion value in ADC ISR.
Definition: adc_hw_trigger/fsl_adc_irq.c:60
void ADC1IRQHandler(void)
ADC Interrupt handler. Get current ADC value and set conversionCompleted flag.
Definition: demo_apps/adc_low_power/main.c:96
uint32_t instance
Definition: driver_examples/flexcan/flexcan_loopback/main.c:50
void ADC_TEST_InstallCallback(uint32_t instance, uint32_t chnGroup, void(*callbackFunc)(void))
User-defined function to install callback.
Definition: adc_hw_trigger/fsl_adc_irq.c:54
Boundaries struct.
Definition: adc_low_power.h:50
int32_t GetCurrentTempValue(void)
Calculate current temperature.
Definition: demo_apps/adc_low_power/main.c:253
void LowPowerTimerIRQHandler(void)
Low Power Timer Interrupt handler. Clear LPT Compare flag.
int32_t upperBoundary
Definition: adc_low_power.h:52
int32_t lowerBoundary
Definition: adc_low_power.h:53