Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
886 killagreg 1
#ifndef _ANALOG_H
2
#define _ANALOG_H
1 ingob 3
 
886 killagreg 4
#include <inttypes.h>
1 ingob 5
 
1180 killagreg 6
extern volatile uint16_t MeasurementCounter;
886 killagreg 7
extern volatile int16_t UBat;
1180 killagreg 8
extern volatile int16_t AdValueGyroNick, AdValueGyroRoll, AdValueGyroYaw;
9
#define HIRES_GYRO_AMPLIFY 8 // the offset corrected HiResGyro values are a factor of 8 scaled to the AdValues
10
extern volatile int16_t HiResGyroNick, HiResGyroRoll;
11
extern volatile int16_t FilterHiResGyroNick, FilterHiResGyroRoll;
12
extern volatile int16_t AdValueAccRoll, AdValueAccNick, AdValueAccTop, AdValueAccZ;
886 killagreg 13
extern volatile int32_t AirPressure;
14
extern volatile int16_t HeightD;
15
extern volatile uint16_t ReadingAirPressure;
1180 killagreg 16
extern volatile int16_t StartAirPressure;
17
extern volatile uint8_t ADReady;
1 ingob 18
 
1180 killagreg 19
extern uint8_t DacOffsetGyroNick, DacOffsetGyroRoll, DacOffsetGyroYaw;
20
extern uint8_t PressureSensorOffset;
21
extern int8_t ExpandBaro;
22
 
23
 
936 killagreg 24
void SearchAirPressureOffset(void);
1180 killagreg 25
void SearchDacGyroOffset(void);
936 killagreg 26
void ADC_Init(void);
1 ingob 27
 
1180 killagreg 28
 
886 killagreg 29
// clear ADC enable & ADC Start Conversion & ADC Interrupt Enable bit
30
#define ADC_Disable() (ADCSRA &= ~((1<<ADEN)|(1<<ADSC)|(1<<ADIE)))
31
// set ADC enable & ADC Start Conversion & ADC Interrupt Enable bit
32
#define ADC_Enable() (ADCSRA |= (1<<ADEN)|(1<<ADSC)|(1<<ADIE))
33
 
34
 
35
#endif //_ANALOG_H
36
 
37