Rev 1155 | Rev 1168 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1155 | Rev 1166 | ||
---|---|---|---|
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 | extern volatile int UBat; |
7 | extern volatile int UBat; |
8 | extern volatile int AdWertNick, AdWertRoll, AdWertGier; |
8 | extern volatile int AdWertNick, AdWertRoll, AdWertGier; |
9 | extern volatile int AdWertAccRoll,AdWertAccNick,AdWertAccHoch; |
9 | extern volatile int AdWertAccRoll,AdWertAccNick,AdWertAccHoch; |
- | 10 | extern volatile int HiResNick, HiResRoll; |
|
- | 11 | extern volatile int AdWertNickFilter, AdWertRollFilter, AdWertGierFilter; |
|
10 | extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
12 | extern volatile int Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az; |
11 | extern volatile long Luftdruck; |
13 | extern volatile long Luftdruck; |
12 | extern volatile char messanzahl_Druck; |
14 | extern volatile char messanzahl_Druck; |
13 | extern volatile unsigned int ZaehlMessungen; |
15 | extern volatile unsigned int ZaehlMessungen; |
14 | extern unsigned char DruckOffsetSetting; |
16 | extern unsigned char DruckOffsetSetting; |
15 | extern signed char ExpandBaro; |
17 | extern signed char ExpandBaro; |
16 | extern volatile int HoeheD; |
18 | extern volatile int HoeheD; |
17 | extern volatile unsigned int MessLuftdruck; |
19 | extern volatile unsigned int MessLuftdruck; |
18 | extern volatile int StartLuftdruck; |
20 | extern volatile int StartLuftdruck; |
19 | extern volatile char MessanzahlNick; |
21 | extern volatile char MessanzahlNick; |
20 | extern unsigned char AnalogOffsetNick,AnalogOffsetRoll,AnalogOffsetGier; |
22 | extern unsigned char AnalogOffsetNick,AnalogOffsetRoll,AnalogOffsetGier; |
21 | extern unsigned char AdReady; |
23 | extern unsigned char AdReady; |
22 | 24 | ||
23 | 25 | ||
24 | unsigned int ReadADC(unsigned char adc_input); |
26 | unsigned int ReadADC(unsigned char adc_input); |
25 | void ADC_Init(void); |
27 | void ADC_Init(void); |
26 | void SucheLuftruckOffset(void); |
28 | void SucheLuftruckOffset(void); |
27 | void SucheGyroOffset(void); |
29 | void SucheGyroOffset(void); |
28 | 30 | ||
29 | #define AD_GIER 0 |
31 | #define AD_GIER 0 |
30 | #define AD_ROLL 1 |
32 | #define AD_ROLL 1 |
31 | #define AD_NICK 2 |
33 | #define AD_NICK 2 |
32 | #define AD_DRUCK 3 |
34 | #define AD_DRUCK 3 |
33 | #define AD_UBAT 4 |
35 | #define AD_UBAT 4 |
34 | #define AD_ACC_Z 5 |
36 | #define AD_ACC_Z 5 |
35 | #define AD_ACC_Y 6 |
37 | #define AD_ACC_Y 6 |
36 | #define AD_ACC_X 7 |
38 | #define AD_ACC_X 7 |
37 | 39 | ||
38 | 40 | ||
39 | #define ANALOG_OFF ADCSRA=0 |
41 | #define ANALOG_OFF ADCSRA=0 |
40 | //#define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADIE) |
- | |
41 | //Free Running Mode, Division Factor 128, Interrupt on |
- | |
- | 42 | ||
42 | #define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(0<<ADPS0)|(1<<ADIE) |
43 | #define ANALOG_ON ADCSRA=(1<<ADEN)|(1<<ADSC)|(0<<ADATE)|(1<<ADPS2)|(1<<ADPS1)|(0<<ADPS0)|(1<<ADIE) |
43 | //Free Running Mode, Division Factor 64, Interrupt on |
44 | //Signle trigger Mode, Interrupt on |
44 | #endif //_ANALOG_H |
45 | #endif //_ANALOG_H |
45 | 46 |