Subversion Repositories FlightCtrl

Rev

Rev 1342 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1227 killagreg 1
#ifndef _ANALOG_H
2
#define _ANALOG_H
3
 
4
#include <inttypes.h>
5
 
6
extern volatile uint16_t MeasurementCounter;
7
extern volatile int16_t UBat;
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;
13
extern volatile int32_t AirPressure;
14
extern volatile int16_t HeightD;
15
extern volatile uint16_t ReadingAirPressure;
16
extern volatile int16_t StartAirPressure;
17
extern volatile uint8_t ADReady;
18
 
19
extern uint8_t DacOffsetGyroNick, DacOffsetGyroRoll, DacOffsetGyroYaw;
20
extern uint8_t PressureSensorOffset;
21
extern int8_t ExpandBaro;
22
 
23
 
24
void SearchAirPressureOffset(void);
25
void SearchDacGyroOffset(void);
26
void ADC_Init(void);
27
 
28
 
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