]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/include/drv/dac.h
Merge port and gpio definitions into one file in the DRV layer
[pes-rpp/rpp-lib.git] / rpp / include / drv / dac.h
1 /**
2  * RPP driver implementation for ADC header file.
3  *
4  * @file adc.h
5  *
6  * @copyright Copyright (C) 2012-2013 Czech Technical University in Prague
7  *
8  * @author Michal Horn
9  * @author Carlos Jenkins <carlos@jenkins.co.cr>
10  */
11
12
13 #ifndef __DRV_DAC_H
14 #define __DRV_DAC_H
15
16 #include "drv/digital_io.h"
17
18
19 /**
20  * Send SPI command to DAC.
21  *
22  * This function translates parameters into a command and sends it through SPI.
23  *
24  * @param[in] pin       The DAC pin number [0-3].
25  *
26  * @return SPI response if successful.
27  *          -1 if pin out of range.
28  *          -2 if value out of range.
29  */
30 int drv_dac_spi_transfer(uint8_t pin, boolean_t enabled, uint16_t value);
31
32
33 #endif /* __DRV_DAC_H */