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
 
886 killagreg 6
extern volatile int16_t UBat;
911 killagreg 7
extern volatile int16_t AdValueGyrNick, AdValueGyrRoll, AdValueGyrYaw;
936 killagreg 8
extern uint8_t AnalogOffsetNick, AnalogOffsetRoll, AnalogOffsetYaw;
911 killagreg 9
extern volatile int16_t AdValueAccRoll, AdValueAccNick, AdValueAccTop;
886 killagreg 10
extern volatile int16_t Current_AccZ;
11
extern volatile int32_t AirPressure;
12
extern volatile uint16_t MeasurementCounter;
1078 killagreg 13
extern int8_t ExpandBaro;
886 killagreg 14
extern uint8_t PressureSensorOffset;
15
extern volatile int16_t HeightD;
16
extern volatile uint16_t ReadingAirPressure;
17
extern volatile int16_t  StartAirPressure;
1 ingob 18
 
936 killagreg 19
void SearchAirPressureOffset(void);
20
void SearchGyroOffset(void);
21
void ADC_Init(void);
1 ingob 22
 
886 killagreg 23
// clear ADC enable & ADC Start Conversion & ADC Interrupt Enable bit
24
#define ADC_Disable() (ADCSRA &= ~((1<<ADEN)|(1<<ADSC)|(1<<ADIE)))
25
// set ADC enable & ADC Start Conversion & ADC Interrupt Enable bit
26
#define ADC_Enable() (ADCSRA |= (1<<ADEN)|(1<<ADSC)|(1<<ADIE))
27
 
28
 
29
#endif //_ANALOG_H
30
 
31