Subversion Repositories MK3Mag

Rev

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

Rev Author Line No. Line
19 killagreg 1
#ifndef _ANALOG_H_
2
#define _ANALOG_H_
1 ingob 3
 
19 killagreg 4
#include <inttypes.h>
5
#include <avr/io.h>
6
 
7
#define FLIP_HIGH  PORTD |=  ((1<<PORTD5)|(1<<PORTD6))
8
#define FLIP_LOW   PORTD &= ~((1<<PORTD5)|(1<<PORTD6))
9
 
10
typedef enum
11
{
12
        ADC0 = 0,
13
        ADC1 = 1,
14
        ADC2 = 2,
15
        ADC3 = 3,
16
        ADC4 = 4,
17
        ADC5 = 5,
18
        ADC6 = 6,
19
        ADC7 = 7,
20
        REF1V1 = 14,
21
        AGND = 15
22
} ADChannel_t;
23
 
29 killagreg 24
 
25
#define MAG_X ADC0
26
#define MAG_Y ADC1
27
#define MAG_Z ADC7
28
#define ACC_X ADC2
29
#define ACC_Y ADC3
30
#define ACC_Z ADC6
31
 
32
 
33
extern uint8_t AccPresent;
34
 
19 killagreg 35
void ADC_Init(void);
36
uint16_t ADC_GetValue(ADChannel_t channel);
37
 
38
#endif // _ANALOG_H_
39