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
demo_apps/cadc_hw_trigger/main.c File Reference
#include <string.h>
#include <stdio.h>
#include "fsl_debug_console.h"
#include "cadc_hw_trigger.h"
#include "fsl_cadc_driver.h"

Data Structures

struct  sparse_node_ptr
 Define the sparse matrix node for display wave. More...
 

Macros

#define ADC_12BIT_MAXVALUE
 
#define RATIO
 

Functions

void init_trigger_source (uint32_t instance)
 Enable the trigger source of LPTimer. More...
 
void deinit_trigger_source (uint32_t instance)
 Disable the trigger source. More...
 
void CADC_TEST_InstallCallbackConvA (uint32_t instance, void(*callbackFunc)(void))
 
uint16_t ADC_TEST_GetConvValueRAWInt (uint32_t instance, uint32_t chnGroup)
 User-defined function to read conversion value in ADC ISR. More...
 
void CADC_TEST_ISRConvA (void)
 ADCA conversion complete ISR. More...
 
static int32_t init_adc (uint32_t instance)
 Initialize the ADCx for HW trigger. More...
 
void sparse_reset (void)
 Reset the sparse matrix. More...
 
void sparse_insert (uint32_t index, uint8_t value)
 insert a node into the sparse matrix More...
 
int main (void)
 Main demo function. More...
 

Variables

SIM_Type *const gSimBase []
 
static volatile bool gAdcDone
 
static sparse_node_ptr gChartHead [CHART_ROWS]
 
static sparse_node_t gChartNodes [NR_SAMPLES]
 
static uint32_t gFreeNode
 
static volatile uint8_t gCurChan
 

Data Structure Documentation

struct sparse_node_t
Data Fields
struct sparse_node * next

next node

uint8_t value

the sample index

Macro Definition Documentation

#define ADC_12BIT_MAXVALUE
#define RATIO

Function Documentation

uint16_t ADC_TEST_GetConvValueRAWInt ( uint32_t  instance,
uint32_t  chnGroup 
)
void CADC_TEST_InstallCallbackConvA ( uint32_t  instance,
void(*)(void)  callbackFunc 
)
void CADC_TEST_ISRConvA ( void  )
void deinit_trigger_source ( uint32_t  adcInstance)

disable the trigger source

static int32_t init_adc ( uint32_t  instance)
static
Parameters
instanceThe ADC instance number
void init_trigger_source ( uint32_t  adcInstance)

enable the trigger source of LPTimer

enable the trigger source

enable the trigger source of PIT0, chn0

enable the trigger source of LPTimer

enable the trigger source

enable the trigger source of PIT0, chn0

enable the trigger source of PWM

enable the trigger source of LPTimer

enable the trigger source

enable the trigger source of PIT0, chn0

enable the trigger source of PWM

int main ( void  )

Function prototype for main function.

void sparse_insert ( uint32_t  index,
uint8_t  value 
)
Parameters
indexThe amplitude index
valueThe sample count value
void sparse_reset ( void  )

Variable Documentation

volatile bool gAdcDone
static
sparse_node_ptr gChartHead[CHART_ROWS]
static
sparse_node_t gChartNodes[NR_SAMPLES]
static
volatile uint8_t gCurChan
static
uint32_t gFreeNode
static
SIM_Type* const gSimBase[]

Conversion is completed Flag