Loading...
Searching...
No Matches
dac.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2014 Simon Brummer
3 * SPDX-FileCopyrightText: 2015-2016 Freie Universität Berlin
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
48
49#include <stdint.h>
50#include <limits.h>
51
52#include "periph_cpu.h"
53#include "periph_conf.h"
54
55#ifdef __cplusplus
56extern "C" {
57#endif
58
62#ifndef HAVE_DAC_T
63typedef uint_fast8_t dac_t;
64#endif
65
69enum {
70 DAC_OK = 0,
71 DAC_NOLINE = -1
72};
73
77#ifndef DAC_UNDEF
78#define DAC_UNDEF (UINT_FAST8_MAX)
79#endif
80
84#ifndef DAC_LINE
85#define DAC_LINE(x) (x)
86#endif
87
99int8_t dac_init(dac_t line);
100
112void dac_set(dac_t line, uint16_t value);
113
120
127
128#ifdef __cplusplus
129}
130#endif
131
uint_fast8_t dac_t
Define default DAC type identifier.
Definition dac.h:63
void dac_set(dac_t line, uint16_t value)
Write a value onto DAC Device on a given Channel.
void dac_poweroff(dac_t line)
Disable the given DAC line.
int8_t dac_init(dac_t line)
Initialize the given DAC line.
void dac_poweron(dac_t line)
Enable the given DAC line.