source: asp3_tinet_ecnl_rx/trunk/asp3_dcre/mbed/hal/analogin_api.h@ 374

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

mbed関連を更新
シリアルドライバをmbedのHALを使うよう変更
ファイルディスクリプタの処理を更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 1.7 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_ANALOGIN_API_H
20#define MBED_ANALOGIN_API_H
21
22#include "device.h"
23
24#if DEVICE_ANALOGIN
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/** Analogin hal structure. analogin_s is declared in the target's hal
31 */
32typedef struct analogin_s analogin_t;
33
34/**
35 * \defgroup hal_analogin Analogin hal functions
36 * @{
37 */
38
39/** Initialize the analogin peripheral
40 *
41 * Configures the pin used by analogin.
42 * @param obj The analogin object to initialize
43 * @param pin The analogin pin name
44 */
45void analogin_init(analogin_t *obj, PinName pin);
46
47/** Read the input voltage, represented as a float in the range [0.0, 1.0]
48 *
49 * @param obj The analogin object
50 * @return A floating value representing the current input voltage
51 */
52float analogin_read(analogin_t *obj);
53
54/** Read the value from analogin pin, represented as an unsigned 16bit value
55 *
56 * @param obj The analogin object
57 * @return An unsigned 16bit value representing the current input voltage
58 */
59uint16_t analogin_read_u16(analogin_t *obj);
60
61/**@}*/
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif
68
69#endif
70
71/** @}*/
Note: See TracBrowser for help on using the repository browser.