![]() |
Kinetis SDK v.1.2 Demo Applications User's Guide
Rev. 0
Freescale Semiconductor, Inc.
|
#include <stdio.h>
#include "board.h"
#include "fsl_pdb_driver.h"
#include "fsl_ftm_driver.h"
#include "fsl_cadc_driver.h"
#include "fsl_debug_console.h"
#include "fsl_sim_hal.h"
#include "fsl_device_registers.h"
#include "arm_math.h"
#include "FirCoefs.h"
Data Structures | |
union | RT_ControlType |
struct | RT_ControlType.Bits |
Macros | |
#define | RT1_ADC_CHL |
ADC channels definition for thermistors using differential input. More... | |
#define | RT2_ADC_CHL |
#define | RT3_ADC_CHL |
#define | RT4_ADC_CHL |
#define | PWM_FREQ_HZ |
PWM frequency. More... | |
#define | DIFF_TS |
Low pass filter */. More... | |
#define | BUFF_SIZE |
#define | SWTMR_TOUT |
S/W timer. More... | |
#define | _100MS |
100 ms period More... | |
#define | TH_TRY |
thresholds More... | |
#define | RT1ONTH |
#define | RT1OFFTH |
#define | RT2ONTH |
#define | RT2OFFTH |
#define | RT3ONTH |
#define | RT3OFFTH |
#define | RT4ONTH |
#define | RT4OFFTH |
#define | Q15 |
FIR algorithm related. More... | |
#define | FRAC16(a) |
#define | TEST_LENGTH_SAMPLES |
#define | BLOCK_SIZE |
#define | NUM_TAPS |
#define | MAX_NO_SAMPLES |
MAX no of ADC samples. More... | |
#define | ALL_LED_ON |
#define | ALL_LED_OFF |
#define | ALL_LED_EN |
Functions | |
void | RT_Check (int16_t i16Rt1, int16_t i16Rt2, int16_t i16Rt3, int16_t i16Rt4) |
check 4 thermistors to see if fingers are close to them or left. More... | |
void | RT_LEDs_On (void) |
static int32_t | init_adc (void) |
Initialize the ADCx for HW trigger. More... | |
int | main (void) |
Function prototype for main function. More... | |
void | ADCA_IRQHandler (void) |
override the ADCA_IRQ handler More... | |
Variables | |
volatile uint16_t | swDiffCNTR |
Global variables. More... | |
volatile uint16_t | swTimerCNTR |
volatile uint16_t | timeout |
volatile RT_ControlType | rton |
volatile uint16_t | rt_filter_on |
volatile uint16_t | rt_filter_off |
volatile int16_t | rt1_filt_buff [BUFF_SIZE] |
volatile int16_t | rt2_filt_buff [BUFF_SIZE] |
volatile int16_t | rt3_filt_buff [BUFF_SIZE] |
volatile int16_t | rt4_filt_buff [BUFF_SIZE] |
volatile uint16_t | i_delay |
volatile uint16_t | i_sample |
int16_t | rt1 |
int16_t | rt2 |
int16_t | rt3 |
int16_t | rt4 |
int16_t | rt1_filt |
int16_t | rt2_filt |
int16_t | rt3_filt |
int16_t | rt4_filt |
int16_t | delta_rt1 |
int16_t | delta_rt2 |
int16_t | delta_rt3 |
int16_t | delta_rt4 |
static int16_t | i16FirStateQ15_1 [BLOCK_SIZE+NUM_TAPS-1] |
Declare FIR State buffer of size (numTaps + u32BlockSize - 1) More... | |
static int16_t | i16FirStateQ15_2 [BLOCK_SIZE+NUM_TAPS-1] |
static int16_t | i16FirStateQ15_3 [BLOCK_SIZE+NUM_TAPS-1] |
static int16_t | i16FirStateQ15_4 [BLOCK_SIZE+NUM_TAPS-1] |
static arm_fir_instance_q15 | S1 |
Instances of FIR internal state. More... | |
static arm_fir_instance_q15 | S2 |
static arm_fir_instance_q15 | S3 |
static arm_fir_instance_q15 | S4 |
uint32_t | u32BlockSize |
uint32_t | u32NumBlocks |
uint16_t | u16Result0A [MAX_NO_SAMPLES] |
For ADC samples. More... | |
uint16_t | u16Result0B [MAX_NO_SAMPLES] |
uint16_t | u16Result1A [MAX_NO_SAMPLES] |
uint16_t | u16Result1B [MAX_NO_SAMPLES] |
volatile uint16_t | u8CycleTimes |
volatile uint16_t | gu8RdCounter |
union RT_ControlType |
Data Fields | ||
---|---|---|
struct RT_ControlType | Bits | |
struct RT_ControlType | Bits | |
uint16_t | W16 |
struct RT_ControlType.Bits |
#define _100MS |
#define ALL_LED_EN |
#define ALL_LED_OFF |
#define ALL_LED_ON |
#define BLOCK_SIZE |
#define BUFF_SIZE |
#define DIFF_TS |
#define FRAC16 | ( | a | ) |
#define MAX_NO_SAMPLES |
#define NUM_TAPS |
#define PWM_FREQ_HZ |
#define Q15 |
#define RT1_ADC_CHL |
#define RT1OFFTH |
#define RT1ONTH |
#define RT2_ADC_CHL |
#define RT2OFFTH |
#define RT2ONTH |
#define RT3_ADC_CHL |
#define RT3OFFTH |
#define RT3ONTH |
#define RT4_ADC_CHL |
#define RT4OFFTH |
#define RT4ONTH |
#define SWTMR_TOUT |
400 ms period
#define TEST_LENGTH_SAMPLES |
#define TH_TRY |
void ADCA_IRQHandler | ( | void | ) |
|
static |
int main | ( | void | ) |
Function prototype for main function.
receiveBuff | Buffer used to hold received data |
void RT_Check | ( | int16_t | i16Rt1, |
int16_t | i16Rt2, | ||
int16_t | i16Rt3, | ||
int16_t | i16Rt4 | ||
) |
This function is called by ADC interrupts.
void RT_LEDs_On | ( | void | ) |
int16_t delta_rt1 |
int16_t delta_rt2 |
int16_t delta_rt3 |
int16_t delta_rt4 |
volatile uint16_t gu8RdCounter |
|
static |
|
static |
|
static |
|
static |
volatile uint16_t i_delay |
volatile uint16_t i_sample |
int16_t rt1 |
int16_t rt1_filt |
volatile int16_t rt1_filt_buff[BUFF_SIZE] |
int16_t rt2 |
int16_t rt2_filt |
volatile int16_t rt2_filt_buff[BUFF_SIZE] |
int16_t rt3 |
int16_t rt3_filt |
volatile int16_t rt3_filt_buff[BUFF_SIZE] |
int16_t rt4 |
int16_t rt4_filt |
volatile int16_t rt4_filt_buff[BUFF_SIZE] |
volatile uint16_t rt_filter_off |
volatile uint16_t rt_filter_on |
volatile RT_ControlType rton |
|
static |
|
static |
|
static |
|
static |
volatile uint16_t swDiffCNTR |
volatile uint16_t swTimerCNTR |
volatile uint16_t timeout |
uint16_t u16Result0A[MAX_NO_SAMPLES] |
uint16_t u16Result0B[MAX_NO_SAMPLES] |
uint16_t u16Result1A[MAX_NO_SAMPLES] |
uint16_t u16Result1B[MAX_NO_SAMPLES] |
uint32_t u32BlockSize |
uint32_t u32NumBlocks |
volatile uint16_t u8CycleTimes |