Defines | Functions | Variables

adc_filtr.h File Reference

#include <system_def.h>
Include dependency graph for adc_filtr.h:
This graph shows which files directly or indirectly include this file:

Defines

#define ADC_MUL   1
 This value multiplies mesured value from ADC.
#define ADC_OFFSET   0
 This valueis added to mesured value from ADC.
#define ACD_HZ   3000
 Sampling frequency.
#define ADC_VPB_DIV   0x80
 VPB divisor.
#define ADC_FILTR_SIZE   201
 Size of the median filter for each channel, be aware sinal size is size * 8.

Functions

void adc_filter (unsigned char chan)
 Median filter for ADC.
void init_adc_filter (unsigned rx_isr_vect)
 Inicializes ADC service for all ADC (4) channels and installs ISR routine to VIC.

Variables

volatile unsigned int adc_val [4]
 Final ADC value.
volatile unsigned int adc_update_adc
 bite oriented, updated when new ADC channel is measured
uint16_t adc_filtr_0_m [ADC_FILTR_SIZE]
uint16_t adc_filtr_1_m [ADC_FILTR_SIZE]
uint16_t adc_filtr_2_m [ADC_FILTR_SIZE]
uint16_t adc_filtr_3_m [ADC_FILTR_SIZE]
volatile uint16_t adc_filtr_0 [ADC_FILTR_SIZE]
volatile uint16_t adc_filtr_1 [ADC_FILTR_SIZE]
volatile uint16_t adc_filtr_2 [ADC_FILTR_SIZE]
volatile uint16_t adc_filtr_3 [ADC_FILTR_SIZE]
volatile uint16_t adc_filtr_p

Define Documentation

#define ACD_HZ   3000

Sampling frequency.

#define ADC_FILTR_SIZE   201

Size of the median filter for each channel, be aware sinal size is size * 8.

#define ADC_MUL   1

This value multiplies mesured value from ADC.

#define ADC_OFFSET   0

This valueis added to mesured value from ADC.

#define ADC_VPB_DIV   0x80

VPB divisor.


Function Documentation

void adc_filter ( unsigned char  chan  ) 

Median filter for ADC.

If new data is available the median is recalculated. This function may be called from main function, it should take long time to calculate the median for all ADC value.

Parameters:
chan bit oriented (0~3) value, defines which ADC channels have new data

Here is the call graph for this function:

Here is the caller graph for this function:

void init_adc_filter ( unsigned  rx_isr_vect  ) 

Inicializes ADC service for all ADC (4) channels and installs ISR routine to VIC.

Automaticly starts the conversion of first channel on given conversion frequency.

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

volatile uint16_t adc_filtr_0[ADC_FILTR_SIZE]
uint16_t adc_filtr_0_m[ADC_FILTR_SIZE]
volatile uint16_t adc_filtr_1[ADC_FILTR_SIZE]
uint16_t adc_filtr_1_m[ADC_FILTR_SIZE]
volatile uint16_t adc_filtr_2[ADC_FILTR_SIZE]
uint16_t adc_filtr_2_m[ADC_FILTR_SIZE]
volatile uint16_t adc_filtr_3[ADC_FILTR_SIZE]
uint16_t adc_filtr_3_m[ADC_FILTR_SIZE]
volatile uint16_t adc_filtr_p
volatile unsigned int adc_update_adc

bite oriented, updated when new ADC channel is measured

volatile unsigned int adc_val[4]

Final ADC value.