source: asp3_tinet_ecnl_arm/trunk/asp3_dcre/mbed/hal/analogout_api.h@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 2.3 KB
Line 
1
2/** \addtogroup hal */
3/** @{*/
4/* mbed Microcontroller Library
5 * Copyright (c) 2006-2013 ARM Limited
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19#ifndef MBED_ANALOGOUT_API_H
20#define MBED_ANALOGOUT_API_H
21
22#include "device.h"
23
24#if DEVICE_ANALOGOUT
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/** Analogout hal structure. dac_s is declared in the target's hal
31 */
32typedef struct dac_s dac_t;
33
34/**
35 * \defgroup hal_analogout Analogout hal functions
36 * @{
37 */
38
39/** Initialize the analogout peripheral
40 *
41 * Configures the pin used by analogout.
42 * @param obj The analogout object to initialize
43 * @param pin The analogout pin name
44 */
45void analogout_init(dac_t *obj, PinName pin);
46
47/** Release the analogout object
48 *
49 * Note: This is not currently used in the mbed-drivers
50 * @param obj The analogout object
51 */
52void analogout_free(dac_t *obj);
53
54/** Set the output voltage, specified as a percentage (float)
55 *
56 * @param obj The analogin object
57 * @param value The floating-point output voltage to be set
58 */
59void analogout_write(dac_t *obj, float value);
60
61/** Set the output voltage, specified as unsigned 16-bit
62 *
63 * @param obj The analogin object
64 * @param value The unsigned 16-bit output voltage to be set
65 */
66void analogout_write_u16(dac_t *obj, uint16_t value);
67
68/** Read the current voltage value on the pin
69 *
70 * @param obj The analogin object
71 * @return A floating-point value representing the current voltage on the pin,
72 * measured as a percentage
73 */
74float analogout_read(dac_t *obj);
75
76/** Read the current voltage value on the pin, as a normalized unsigned 16bit value
77 *
78 * @param obj The analogin object
79 * @return An unsigned 16-bit value representing the current voltage on the pin
80 */
81uint16_t analogout_read_u16(dac_t *obj);
82
83/**@}*/
84
85#ifdef __cplusplus
86}
87#endif
88
89#endif
90
91#endif
92
93/** @}*/
Note: See TracBrowser for help on using the repository browser.