2014-10-27 16:33:49 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Freie Universität Berlin
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
2013-11-27 17:54:30 +01:00
|
|
|
/**
|
|
|
|
* @defgroup drivers_adc ADC
|
|
|
|
* @ingroup drivers
|
2014-05-24 16:06:05 +02:00
|
|
|
* @brief Generic interface for ADC drivers
|
2014-10-25 16:36:10 +02:00
|
|
|
* @deprecated This interface is obsolete. Use the @ref driver_periph_adc
|
|
|
|
* interface in @ref driver_periph instead.
|
2013-11-27 17:54:30 +01:00
|
|
|
*
|
2014-10-27 16:33:49 +01:00
|
|
|
* @author Oliver Hahm <oliver.hahm@inria.fr>
|
|
|
|
*
|
2014-10-25 16:36:10 +02:00
|
|
|
* @{
|
|
|
|
* @file
|
2013-11-27 17:54:30 +01:00
|
|
|
*/
|
|
|
|
|
2012-02-16 22:14:47 +01:00
|
|
|
#ifndef ADC_H
|
2013-06-21 22:36:48 +02:00
|
|
|
#define ADC_H
|
2012-02-16 22:14:47 +01:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2014-10-13 15:49:17 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-02-16 22:14:47 +01:00
|
|
|
/**
|
2013-11-27 17:54:30 +01:00
|
|
|
* @brief Initialize ADC.
|
2012-02-16 22:14:47 +01:00
|
|
|
*/
|
|
|
|
void adc_init(void);
|
|
|
|
|
|
|
|
/**
|
2013-11-27 17:54:30 +01:00
|
|
|
* @brief Read ADC value of selected channel.
|
2012-02-16 22:14:47 +01:00
|
|
|
*
|
|
|
|
* Valid channel numbers are from 0 to 2.
|
|
|
|
*
|
2013-11-27 17:54:30 +01:00
|
|
|
* @return ADC value of selected channel.
|
2012-02-16 22:14:47 +01:00
|
|
|
*/
|
|
|
|
uint16_t adc_read(uint8_t channel);
|
|
|
|
|
2014-10-13 15:49:17 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-11-27 17:54:30 +01:00
|
|
|
/** @} */
|
2012-02-16 22:14:47 +01:00
|
|
|
#endif /* ADC_H */
|