eRTK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
adc.h
Go to the documentation of this file.
1 /*
2  * adc.h
3  *
4  * Created: 27.05.2015 14:45:41
5  * Author: er
6  */
7 
8 
9 #ifndef ADC_H_
10 #define ADC_H_
11 
12 #define ADC_HZ1000 1
13 #define ADC_HZ100 10
14 #define ADC_HZ10 100
15 #define ADC_HZ5 200
16 
17 
18 #define ANZ_ADC 2
19 typedef struct {
20  uint8_t mux; //0..15 beim atmega256x
21  uint8_t ref; //wert fuer referenz
22  uint8_t scaler; //0=nie, 1=jeden lauf, 2=jeden 2ten lauf, usw
23  uint8_t cnt; //aufwaertszaehler
24  uint16_t value; //adc messwert
25  uint8_t tid; //wenn eine task gestartet werden soll
26  } tadc;
27 extern tadc adc_cntrl[ANZ_ADC];
28 
29 uint8_t adc_sequencer( void ); //soll im system timer interrupt aufgerufen werden
30 uint16_t adc_get( uint8_t mux ); //holen des aktuellen wandlungswertes
31 uint16_t adc_wait( uint8_t mux ); //warten bis auf diesem kanal eine neue messung vorliegt und dann liefern
32 void adc_init( void ); //beim hochlauf aufzurufen
33 
34 #endif /* ADC_H_ */
uint8_t cnt
Definition: adc.h:23
uint8_t scaler
Definition: adc.h:22
uint16_t adc_get(uint8_t mux)
Definition: adc.c:124
#define ANZ_ADC
Definition: adc.h:18
uint8_t ref
Definition: adc.h:21
Definition: adc.h:19
void adc_init(void)
tadc adc_cntrl[ANZ_ADC]
Definition: main.c:77
uint8_t tid
Definition: adc.h:25
uint16_t value
Definition: adc.h:24
uint8_t adc_sequencer(void)
uint8_t mux
Definition: adc.h:20
uint16_t adc_wait(uint8_t mux)
Definition: adc.c:139