The friendly Operating System for the Internet of Things
adc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2015 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
43 #ifndef PERIPH_ADC_H
44 #define PERIPH_ADC_H
45 
46 #include <limits.h>
47 
48 #include "periph_cpu.h"
49 #include "periph_conf.h"
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
59 #ifndef HAVE_ADC_T
60 typedef unsigned int adc_t;
61 #endif
62 
68 #ifndef ADC_UNDEF
69 #define ADC_UNDEF (UINT_MAX)
70 #endif
71 
77 #ifndef ADC_LINE
78 #define ADC_LINE(x) (x)
79 #endif
80 
86 #ifndef HAVE_ADC_RES_T
87 typedef enum {
94 } adc_res_t;
95 #endif
96 
108 int adc_init(adc_t line);
109 
124 int adc_sample(adc_t line, adc_res_t res);
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif /* PERIPH_ADC_H */
131 
ADC resolution: 12 bit.
Definition: adc.h:91
int adc_sample(adc_t line, adc_res_t res)
Sample a value from the given ADC line.
adc_res_t
Possible ADC resolution settings.
Definition: adc.h:87
unsigned int adc_t
Define default ADC type identifier.
Definition: adc.h:60
int adc_init(adc_t line)
Initialize the given ADC line.
ADC resolution: 14 bit.
Definition: adc.h:92
ADC resolution: 10 bit.
Definition: adc.h:90
ADC resolution: 16 bit.
Definition: adc.h:93
ADC resolution: 8 bit.
Definition: adc.h:89
ADC resolution: 6 bit.
Definition: adc.h:88