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 
63 enum {
64  DAC_OK = 0,
65  DAC_NOLINE = -1
66 };
67 
72 #ifndef DAC_UNDEF
73 #define DAC_UNDEF (UINT_MAX)
74 #endif
75 
81 #ifndef DAC_LINE
82 #define DAC_LINE(x) (x)
83 #endif
84 
97 int8_t dac_init(dac_t line);
98 
110 void dac_set(dac_t line, uint16_t value);
111 
117 void dac_poweron(dac_t line);
118 
124 void dac_poweroff(dac_t line);
125 
126 
127 #ifdef __cplusplus
128 }
129 #endif
130 
131 #endif /* PERIPH_DAC_H */
132 
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