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_inf.c File Reference
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include "adc_inf.h"
#include "fsl_smc_hal.h"
#include "fsl_pmc_hal.h"
#include "fsl_adc16_driver.h"
#include "board.h"
#include "fsl_os_abstraction.h"

Macros

#define ADC_0
 
#define CHANNEL_0
 
#define LED_ON
 
#define LED_OFF
 
#define ADCR_VDD
 These values are used to get the temperature. DO NOT MODIFY The method used in this demo to calculate temperature of chip is mapped to Temperature Sensor for the HCS08 Microcontroller Family document (Document Number: AN3031) More...
 
#define V_BG
 
#define V_TEMP25
 
#define M
 
#define STANDARD_TEMP
 
#define UPPER_VALUE_LIMIT
 
#define LOWER_VALUE_LIMIT
 
#define UPDATE_BOUNDARIES_TIME
 
#define ADC16_TEMPERATURE_CHN
 
#define ADC16_BANDGAP_CHN
 

Functions

void ADCIRQHandler (void)
 ADC Interrupt Handler. More...
 
void calibrateParams (void)
 Parameters calibration: VDD and ADCR_TEMP25. More...
 
int32_t init_adc (uint32_t instance)
 Initialize the ADCx for HW trigger. More...
 
int32_t GetCurrentTempValue (void)
 Calculate the current temperature. More...
 
lowPowerAdcBoundaries_t TempSensorCalibration (uint32_t updateBoundariesCounter, int32_t *tempArray)
 Calculate the average temperature and set boundaries. More...
 

Variables

static uint32_t adcValue
 
static uint32_t adcrTemp25
 
static uint32_t adcr100m
 
volatile bool conversionCompleted
 
int32_t currentTemperature
 

Macro Definition Documentation

#define ADC16_BANDGAP_CHN
#define ADC16_TEMPERATURE_CHN
#define ADC_0
#define ADCR_VDD
#define CHANNEL_0
#define LED_OFF
#define LED_ON
#define LOWER_VALUE_LIMIT
#define M
#define STANDARD_TEMP
#define UPDATE_BOUNDARIES_TIME
#define UPPER_VALUE_LIMIT
#define V_BG
#define V_TEMP25

Function Documentation

void ADCIRQHandler ( void  )
void calibrateParams ( void  )

Parameters calibration: VDD and ADCR_TEMP25

ADC value of BANDGAP

VDD in mV

int32_t GetCurrentTempValue ( void  )

Calculate current temperature.

int32_t init_adc ( uint32_t  instance)
Parameters
instanceThe ADC instance number
lowPowerAdcBoundaries_t TempSensorCalibration ( uint32_t  updateBoundariesCounter,
int32_t *  tempArray 
)

Calculate current temperature.

Variable Documentation

uint32_t adcr100m
static

Calibrated ADCR_TEMP25

uint32_t adcrTemp25
static

ADC value

uint32_t adcValue
static
volatile bool conversionCompleted
int32_t currentTemperature

Conversion is completed Flag