Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2247 - 1
/*****************************************************************************************************************************
2
* File:                 analog.h
3
* Purpose:              header of analog.c
4
*****************************************************************************************************************************/
5
#ifndef _ANALOG_H
6
 #define _ANALOG_H
7
 
8
#define SM_FILTER 16
9
 
10
extern volatile int UBat;                                                                                                       // Voltage
11
extern volatile int AdWertNick, AdWertRoll, AdWertGier;
12
extern volatile int AdWertAccRoll,AdWertAccNick,AdWertAccHoch;
13
extern volatile int HiResNick, HiResRoll;
14
extern volatile int AdWertNickFilter, AdWertRollFilter, AdWertGierFilter;
15
extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az;
16
 
17
extern volatile char MessanzahlNick;
18
extern unsigned char AnalogOffsetNick, AnalogOffsetRoll, AnalogOffsetGier;      // to be passed to DAC
19
extern volatile unsigned char AdReady;                                                                          // ready with ADC in analog.c
20
 
21
extern volatile int  StartLuftdruck;
22
extern volatile long Luftdruck;
23
extern volatile long SummenHoehe;
24
extern volatile char messanzahl_Druck;
25
extern volatile unsigned int ZaehlMessungen;
26
extern unsigned char DruckOffsetSetting;
27
extern signed char ExpandBaro;
28
extern volatile int VarioMeter;
29
extern volatile unsigned int  MessLuftdruck;
30
 
31
// ----------------------------------------------- functions ------------------------------------
32
unsigned int ReadADC(unsigned char adc_input);
33
void ADC_Init(void);
34
 
35
void SucheLuftruckOffset(void);
36
void SucheGyroOffset(void);
37
 
38
//------------------------------------ definitions ----------------------------------------------
39
#define AD_GIER     0
40
#define AD_ROLL     1
41
#define AD_NICK     2
42
#define AD_DRUCK    3
43
#define AD_UBAT     4
44
#define AD_ACC_Z    5
45
#define AD_ACC_Y    6
46
#define AD_ACC_X    7
47
 
48
#define ANALOG_OFF ADCSRA=0
49
 
50
// switch on ADCs at Single trigger Mode, Interrupt on
51
#define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(0<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE)
52
 
53
#endif
54
// *** EOF: _ANALOG_H ******************************************************************************************************