Subversion Repositories FlightCtrl

Rev

Rev 750 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 750 Rev 761
1
#ifndef _ANALOG_H
1
#ifndef _ANALOG_H
2
#define _ANALOG_H
2
#define _ANALOG_H
3
 
3
 
4
#include <inttypes.h>
4
#include <inttypes.h>
5
 
5
 
6
extern volatile int16_t UBat;
6
extern volatile int16_t UBat;
7
extern volatile int16_t AdValueGyrPitch, AdValueGyrRoll, AdValueGyrYaw;
7
extern volatile int16_t AdValueGyrPitch, AdValueGyrRoll, AdValueGyrYaw;
8
extern volatile int16_t AdValueAccRoll, AdValueAccPitch, AdValueAccTop;
8
extern volatile int16_t AdValueAccRoll, AdValueAccPitch, AdValueAccTop;
9
extern volatile int16_t Current_AccX, Current_AccY, Current_AccZ;
9
extern volatile int16_t Current_AccX, Current_AccY, Current_AccZ;
10
extern volatile int32_t AirPressure;
10
extern volatile int32_t AirPressure;
11
extern volatile uint16_t MeasurementCounter;
11
extern volatile uint16_t MeasurementCounter;
12
extern uint8_t PressureSensorOffset;
12
extern uint8_t PressureSensorOffset;
13
extern volatile int16_t HightD;
13
extern volatile int16_t HeightD;
14
extern volatile uint16_t ReadingAirPressure;
14
extern volatile uint16_t ReadingAirPressure;
15
extern volatile int16_t  StartAirPressure;
15
extern volatile int16_t  StartAirPressure;
16
 
16
 
17
extern void SearchAirPressureOffset(void);
17
extern void SearchAirPressureOffset(void);
18
 
18
 
19
extern void ADC_Init(void);
19
extern void ADC_Init(void);
20
 
20
 
21
// clear ADC enable & ADC Start Conversion & ADC Interrupt Enable bit
21
// clear ADC enable & ADC Start Conversion & ADC Interrupt Enable bit
22
#define ADC_Disable() (ADCSRA &= ~((1<<ADEN)|(1<<ADSC)|(1<<ADIE)))
22
#define ADC_Disable() (ADCSRA &= ~((1<<ADEN)|(1<<ADSC)|(1<<ADIE)))
23
// set ADC enable & ADC Start Conversion & ADC Interrupt Enable bit
23
// set ADC enable & ADC Start Conversion & ADC Interrupt Enable bit
24
#define ADC_Enable() (ADCSRA |= (1<<ADEN)|(1<<ADSC)|(1<<ADIE))
24
#define ADC_Enable() (ADCSRA |= (1<<ADEN)|(1<<ADSC)|(1<<ADIE))
25
 
25
 
26
 
26
 
27
#endif //_ANALOG_H
27
#endif //_ANALOG_H
28
 
28
 
29
 
29
 
30
 
30