The friendly Operating System for the Internet of Things
dac.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Simon Brummer
3  * 2015-2016 Freie Universit├Ąt Berlin
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
38 #ifndef PERIPH_DAC_H
39 #define PERIPH_DAC_H
40 
41 #include <stdint.h>
42 #include <limits.h>
43 
44 #include "periph_cpu.h"
45 #include "periph_conf.h"
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
55 #ifndef HAVE_DAC_T
56 typedef unsigned int dac_t;
57 #endif
58 
64 #ifndef DAC_UNDEF
65 #define DAC_UNDEF (UINT_MAX)
66 #endif
67 
73 #ifndef DAC_LINE
74 #define DAC_LINE(x) (x)
75 #endif
76 
86 int8_t dac_init(dac_t line);
87 
94 void dac_set(dac_t line, uint16_t value);
95 
101 void dac_poweron(dac_t line);
102 
108 void dac_poweroff(dac_t line);
109 
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif /* PERIPH_DAC_H */
116 
void dac_set(dac_t line, uint16_t value)
Write a value onto DAC Device on a given Channel.
int8_t dac_init(dac_t line)
Initialize the given DAC line.
void dac_poweron(dac_t line)
Enable the given DAC line.
void dac_poweroff(dac_t line)
Disable the given DAC line.
unsigned int dac_t
Define default DAC type identifier.
Definition: dac.h:56