Subversion Repositories idreammicro-avr

Rev

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

Rev Author Line No. Line
33 jlesech 1
/**************************************************************************//**
2
 * \brief ADC library.
3
 * \author Copyright (C) 2012  Julien Le Sech - www.idreammicro.com
4
 * \version 1.0
5
 * \date 20121029
6
 *
7
 * This file is part of the iDreamMicro library.
8
 *
9
 * This library is free software: you can redistribute it and/or modify it under
10
 * the terms of the GNU Lesser General Public License as published by the Free
11
 * Software Foundation, either version 3 of the License, or (at your option) any
12
 * later version.
13
 *
14
 * This library is distributed in the hope that it will be useful, but WITHOUT
15
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17
 * details.
18
 *
19
 * You should have received a copy of the GNU Lesser General Public License
20
 * along with this program. If not, see http://www.gnu.org/licenses/
21
 ******************************************************************************/
22
 
23
/**************************************************************************//**
24
 * \headerfile adc.h
25
 ******************************************************************************/
26
 
27
#ifndef H__IDREAMMICRO__ADC__H
28
#define H__IDREAMMICRO__ADC__H
29
 
30
#ifdef _cplusplus
31
extern "C"{
32
#endif
33
 
34
/******************************************************************************
35
 * Header file inclusions.
36
 ******************************************************************************/
37
 
38
#include <stdint.h>
39
 
40
/******************************************************************************
41
 * Public type definitions.
42
 ******************************************************************************/
43
 
44
/**************************************************************************//**
59 jlesech 45
 * \enum    adc__channels
46
 * \brief   ADC channels.
33 jlesech 47
 *
59 jlesech 48
 * \typedef adc__channel_t
49
 * \brief   ADC channel.
33 jlesech 50
 ******************************************************************************/
51
typedef enum adc__channels
52
{
59 jlesech 53
    ADC__CHANNEL_0, /*!<  Channel 0. */
54
    ADC__CHANNEL_1, /*!<  Channel 1. */
55
    ADC__CHANNEL_2, /*!<  Channel 2. */
56
    ADC__CHANNEL_3, /*!<  Channel 3. */
57
    ADC__CHANNEL_4, /*!<  Channel 4. */
58
    ADC__CHANNEL_5, /*!<  Channel 5. */
59
    ADC__CHANNEL_6, /*!<  Channel 6. */
60
    ADC__CHANNEL_7, /*!<  Channel 7. */
61
    ADC__CHANNEL_8  /*!<  Channel 8. */
33 jlesech 62
} adc__channel_t;
63
 
64
/******************************************************************************
65
 * Public function prototypes.
66
 ******************************************************************************/
67
 
68
/**************************************************************************//**
69
 * \fn void adc__single_channel_initialize(adc__channel_t channel)
70
 *
71
 * \brief Initialize ADC.
72
 *
73
 * \param channel   ADC channel.
74
 ******************************************************************************/
75
void
76
adc__single_channel_initialize
77
(
78
    adc__channel_t channel
79
);
80
 
81
/**************************************************************************//**
59 jlesech 82
 * \fn uint16_t adc__single_channel_read(void)
33 jlesech 83
 *
84
 * \brief Read ADC.
85
 *
86
 * \return Read value.
87
 ******************************************************************************/
88
uint16_t
89
adc__single_channel_read
90
(
91
    void
92
);
93
 
94
#ifdef _cplusplus
95
}
96
#endif
97
 
98
#endif /* H__IDREAMMICRO__ADC__H */
99