Rev 2370 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2370 | Rev 2426 | ||
---|---|---|---|
1 | #ifndef _ANALOG_H |
1 | #ifndef _ANALOG_H |
2 | #define _ANALOG_H |
2 | #define _ANALOG_H |
3 | /*####################################################################################### |
3 | /*####################################################################################### |
4 | 4 | ||
5 | #######################################################################################*/ |
5 | #######################################################################################*/ |
6 | 6 | ||
7 | #define SM_FILTER 16 |
7 | #define SM_FILTER 16 |
8 | #define SA_FILTER 512 |
8 | #define SA_FILTER 512 |
9 | 9 | ||
10 | extern volatile int UBat; |
10 | extern volatile int UBat; |
11 | extern volatile int AdWertNick, AdWertRoll, AdWertGier; |
11 | extern volatile int AdWertNick, AdWertRoll, AdWertGier; |
12 | extern volatile int AdWertAccRoll,AdWertAccNick,AdWertAccHoch; |
12 | extern volatile int AdWertAccRoll,AdWertAccNick,AdWertAccHoch; |
13 | extern volatile int HiResNick, HiResRoll; |
13 | extern volatile int HiResNick, HiResRoll; |
14 | extern volatile int AdWertNickFilter, AdWertRollFilter, AdWertGierFilter; |
14 | extern volatile int AdWertNickFilter, AdWertRollFilter, AdWertGierFilter; |
15 | extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
15 | extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
16 | extern volatile long Luftdruck; |
16 | extern volatile long Luftdruck; |
17 | extern volatile long SummenHoehe; |
17 | extern volatile long SummenHoehe; |
18 | extern volatile char messanzahl_Druck; |
18 | extern volatile char messanzahl_Druck; |
19 | extern volatile unsigned int ZaehlMessungen; |
19 | extern volatile unsigned int ZaehlMessungen; |
20 | extern unsigned char DruckOffsetSetting; |
20 | extern unsigned char DruckOffsetSetting; |
21 | extern signed char ExpandBaro; |
21 | extern signed char ExpandBaro; |
22 | extern volatile int VarioMeter; |
22 | extern volatile int VarioMeter; |
23 | extern volatile unsigned int MessLuftdruck; |
23 | extern volatile unsigned int MessLuftdruck; |
24 | extern volatile long StartLuftdruck; |
24 | extern volatile long StartLuftdruck; |
25 | extern volatile char MessanzahlNick; |
25 | extern volatile char MessanzahlNick; |
26 | extern unsigned char AnalogOffsetNick,AnalogOffsetRoll,AnalogOffsetGier; |
26 | extern unsigned char AnalogOffsetNick,AnalogOffsetRoll,AnalogOffsetGier; |
27 | extern volatile unsigned char AdReady; |
27 | extern volatile unsigned char AdReady; |
28 | extern unsigned int BaroStep; |
28 | extern unsigned int BaroStep; |
29 | volatile long HoehenWertF; |
29 | volatile long HoehenWertF; |
30 | unsigned int ReadADC(unsigned char adc_input); |
30 | unsigned int ReadADC(unsigned char adc_input); |
31 | void ADC_Init(void); |
31 | void ADC_Init(void); |
32 | void SucheLuftruckOffset(void); |
32 | void SucheLuftruckOffset(void); |
33 | void SucheGyroOffset(void); |
33 | //void SucheGyroOffset(void); |
34 | void CalcExpandBaroStep(void); |
34 | void CalcExpandBaroStep(void); |
35 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
35 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
36 | extern unsigned char CalAthmospheare; |
36 | extern unsigned char CalAthmospheare; |
37 | #endif |
37 | #endif |
38 | 38 | ||
39 | #define AD_GIER 0 |
39 | #define AD_GIER 0 |
40 | #define AD_ROLL 1 |
40 | #define AD_ROLL 1 |
41 | #define AD_NICK 2 |
41 | #define AD_NICK 2 |
42 | #define AD_DRUCK 3 |
42 | #define AD_DRUCK 3 |
43 | #define AD_UBAT 4 |
43 | #define AD_UBAT 4 |
44 | #define AD_ACC_Z 5 |
44 | #define AD_ACC_Z 5 |
45 | 45 | ||
46 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
46 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
47 | extern unsigned char AD_ACC_Y; |
47 | extern unsigned char AD_ACC_Y; |
48 | extern unsigned char AD_ACC_X; |
48 | extern unsigned char AD_ACC_X; |
49 | #else |
49 | #else |
50 | #define AD_ACC_Y 6 |
50 | #define AD_ACC_Y 6 |
51 | #define AD_ACC_X 7 |
51 | #define AD_ACC_X 7 |
52 | #endif |
52 | #endif |
53 | 53 | ||
54 | #define ANALOG_OFF ADCSRA=0 |
54 | #define ANALOG_OFF ADCSRA=0 |
55 | 55 | ||
56 | #define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(0<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
56 | #define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(0<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
57 | //Signle trigger Mode, Interrupt on |
57 | //Signle trigger Mode, Interrupt on |
58 | #endif //_ANALOG_H |
58 | #endif //_ANALOG_H |
59 | 59 |