Mein Campus
UniviS
Lageplan
Friedrich-Alexander-Universität Erlangen-Nürnberg
/
Technische Fakultät
/
Department Informatik
Team
Forschung
Publikationen
Lehre
Examensarbeiten
CS 4
/
Lehre
/
WS 2021
/
SPiC
/
SPiCboard
adc.h Source File
SPiC
Übersicht
Stundenplan
Semesterplan
Vorlesung
Inhalt
Folien
Übungen
Inhalt
Tafelübung
Rechnerübung
Aufgaben
SPiCboard
Bauanleitung
Programmieren im CIP
Programmieren von zu Hause
libspicboard-Doku
SPiC-IDE
SPiCsim
FAQ
Projekte
Linux libc-Doku
Prüfung
Evaluation
Intern
Inhaltliche Fragen (Tutoren):
i4spic@lists.cs.fau.de
Organisatorische Fragen (Mitarbeiter):
i4spic-orga@lists.cs.fau.de
libspicboard
adc.h
Go to the documentation of this file.
1
#ifndef ADC_H
2
#define ADC_H
3
4
#include <stdint.h>
5
6
#include "
check.h
"
7
8
/**
9
* \addtogroup ADC ADC (Analog to Digital Converter)
10
*
11
* \brief Interface to the AD-converter of the ATmega32, which allows to
12
* query the potentiometer and the photosensor of the board
13
*
14
* @{
15
* \file adc.h
16
* \version \$Rev: 7715 $
17
*/
18
19
/**
20
* \brief Device ids of available periphery connected to ADC channels
21
*/
22
typedef
enum
{
23
POTI
= 0,
/**< the potentiometer (rotation towards LEDs yields higher numbers) **/
24
PHOTO
= 1
/**< the photosensor (brighter ambience yields higher numbers) **/
25
} __attribute__ ((__packed__))
ADCDEV
;
26
27
CHECK_ENUM_SIZE
(
ADCDEV
, 1)
28
29
/**
30
* \brief Perform a 10-bit A/D conversion for a specific channel/device
31
*
32
* \param dev id of a device connected to the ADC
33
*
34
* \retval >=0 10-bit result of the conversion
35
* \retval -1 invalid device id
36
*/
37
int16_t
sb_adc_read
(
ADCDEV
dev);
38
39
/** @}*/
40
41
#endif
42
CHECK_ENUM_SIZE
#define CHECK_ENUM_SIZE(VAR, LEN)
Definition:
check.h:73
check.h
ADCDEV
ADCDEV
Device ids of available periphery connected to ADC channels.
Definition:
adc.h:22
PHOTO
Definition:
adc.h:24
POTI
Definition:
adc.h:23
sb_adc_read
int16_t sb_adc_read(ADCDEV dev)
Perform a 10-bit A/D conversion for a specific channel/device.