1 /*
2  * Copyright (C) 2015-2020 Alibaba Group Holding Limited
3  */
4 
5 #include "aos/hal/dac.h"
6 
7 /**
8  * Initialises an dac interface
9  *
10  * @param[in]  dac  the interface which should be initialised
11  *
12  * @return  0 : on success, EIO : if an error occurred with any step
13  */
hal_dac_init(dac_dev_t * dac)14 int32_t hal_dac_init(dac_dev_t *dac)
15 {
16 	return 0;
17 }
18 
19 /**
20  * Start output dac
21  *
22  * @param[in]   dac      the interface which should be started
23  * @param[out]  channel  the channel to output dac
24  *
25  * @return  0 : on success, EIO : if an error occurred with any step
26  */
hal_dac_start(dac_dev_t * dac,uint32_t channel)27 int32_t hal_dac_start(dac_dev_t *dac, uint32_t channel)
28 {
29 	return 0;
30 }
31 
32 /**
33  * Stop output dac
34  *
35  * @param[in]   dac      the interface which should be stopped
36  * @param[out]  channel  the channel to output dac
37  *
38  * @return  0 : on success, EIO : if an error occurred with any step
39  */
hal_dac_stop(dac_dev_t * dac,uint32_t channel)40 int32_t hal_dac_stop(dac_dev_t *dac, uint32_t channel)
41 {
42 	return 0;
43 }
44 
45 /**
46  * Output a value to an dac interface
47  *
48  * @param[in]   dac      the interface to set value
49  * @param[out]  channel  the channel to output dac
50  * @param[in]   data     the value to output
51  *
52  * @return  0 : on success, EIO : if an error occurred with any step
53  */
hal_dac_set_value(dac_dev_t * dac,uint32_t channel,uint32_t data)54 int32_t hal_dac_set_value(dac_dev_t *dac, uint32_t channel, uint32_t data)
55 {
56 	return 0;
57 }
58 
59 /**
60  * Returns the last data output value of the selected dac channel
61  *
62  * @param[in]   dac      the interface to get value
63  * @param[out]  channel  channel  the channel to output dac
64  *
65  * @return  dac output value
66  */
hal_dac_get_value(dac_dev_t * dac,uint32_t channel)67 int32_t hal_dac_get_value(dac_dev_t *dac, uint32_t channel)
68 {
69 	return 0;
70 }
71 
72 /**
73  * De-initialises an dac interface, Turns off an dac hardware interface
74  *
75  * @param[in]  dac  the interface which should be de-initialised
76  *
77  * @return  0 : on success, EIO : if an error occurred with any step
78  */
hal_dac_finalize(dac_dev_t * dac)79 int32_t hal_dac_finalize(dac_dev_t *dac)
80 {
81 	return 0;
82 }
83 
84