Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1155 | hbuss | 1 | #ifndef _ANALOG_H |
2 | #define _ANALOG_H |
||
1 | ingob | 3 | /*####################################################################################### |
4 | |||
5 | #######################################################################################*/ |
||
6 | |||
1322 | hbuss | 7 | #define SM_FILTER 16 |
2309 | holgerb | 8 | #define SA_FILTER 512 |
1322 | hbuss | 9 | |
1 | ingob | 10 | extern volatile int UBat; |
395 | hbuss | 11 | extern volatile int AdWertNick, AdWertRoll, AdWertGier; |
12 | extern volatile int AdWertAccRoll,AdWertAccNick,AdWertAccHoch; |
||
1166 | hbuss | 13 | extern volatile int HiResNick, HiResRoll; |
14 | extern volatile int AdWertNickFilter, AdWertRollFilter, AdWertGierFilter; |
||
1 | ingob | 15 | extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
16 | extern volatile long Luftdruck; |
||
1322 | hbuss | 17 | extern volatile long SummenHoehe; |
1 | ingob | 18 | extern volatile char messanzahl_Druck; |
19 | extern volatile unsigned int ZaehlMessungen; |
||
20 | extern unsigned char DruckOffsetSetting; |
||
1036 | hbuss | 21 | extern signed char ExpandBaro; |
1253 | killagreg | 22 | extern volatile int VarioMeter; |
1 | ingob | 23 | extern volatile unsigned int MessLuftdruck; |
2309 | holgerb | 24 | extern volatile long StartLuftdruck; |
395 | hbuss | 25 | extern volatile char MessanzahlNick; |
918 | hbuss | 26 | extern unsigned char AnalogOffsetNick,AnalogOffsetRoll,AnalogOffsetGier; |
1253 | killagreg | 27 | extern volatile unsigned char AdReady; |
2367 | holgerb | 28 | extern unsigned int BaroStep; |
2316 | holgerb | 29 | volatile long HoehenWertF; |
304 | ingob | 30 | unsigned int ReadADC(unsigned char adc_input); |
31 | void ADC_Init(void); |
||
32 | void SucheLuftruckOffset(void); |
||
918 | hbuss | 33 | void SucheGyroOffset(void); |
2367 | holgerb | 34 | void CalcExpandBaroStep(void); |
2369 | holgerb | 35 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
36 | extern unsigned char CalAthmospheare; |
||
37 | #endif |
||
1 | ingob | 38 | |
1155 | hbuss | 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 |
||
2370 | holgerb | 45 | |
46 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
||
47 | extern unsigned char AD_ACC_Y; |
||
48 | extern unsigned char AD_ACC_X; |
||
49 | #else |
||
1155 | hbuss | 50 | #define AD_ACC_Y 6 |
51 | #define AD_ACC_X 7 |
||
2370 | holgerb | 52 | #endif |
1 | ingob | 53 | |
54 | #define ANALOG_OFF ADCSRA=0 |
||
1166 | hbuss | 55 | |
1171 | hbuss | 56 | #define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(0<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
1166 | hbuss | 57 | //Signle trigger Mode, Interrupt on |
1155 | hbuss | 58 | #endif //_ANALOG_H |