Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of TUKS-COURSE-TIMER by
analogin_api.h
00001 00002 /** \addtogroup hal */ 00003 /** @{*/ 00004 /* mbed Microcontroller Library 00005 * Copyright (c) 2006-2013 ARM Limited 00006 * 00007 * Licensed under the Apache License, Version 2.0 (the "License"); 00008 * you may not use this file except in compliance with the License. 00009 * You may obtain a copy of the License at 00010 * 00011 * http://www.apache.org/licenses/LICENSE-2.0 00012 * 00013 * Unless required by applicable law or agreed to in writing, software 00014 * distributed under the License is distributed on an "AS IS" BASIS, 00015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00016 * See the License for the specific language governing permissions and 00017 * limitations under the License. 00018 */ 00019 #ifndef MBED_ANALOGIN_API_H 00020 #define MBED_ANALOGIN_API_H 00021 00022 #include "device.h" 00023 00024 #if DEVICE_ANALOGIN 00025 00026 #ifdef __cplusplus 00027 extern "C" { 00028 #endif 00029 00030 /** Analogin hal structure. analogin_s is declared in the target's hal 00031 */ 00032 typedef struct analogin_s analogin_t; 00033 00034 /** 00035 * \defgroup hal_analogin Analogin hal functions 00036 * @{ 00037 */ 00038 00039 /** Initialize the analogin peripheral 00040 * 00041 * Configures the pin used by analogin. 00042 * @param obj The analogin object to initialize 00043 * @param pin The analogin pin name 00044 */ 00045 void analogin_init(analogin_t *obj, PinName pin); 00046 00047 /** Read the input voltage, represented as a float in the range [0.0, 1.0] 00048 * 00049 * @param obj The analogin object 00050 * @return A floating value representing the current input voltage 00051 */ 00052 float analogin_read(analogin_t *obj); 00053 00054 /** Read the value from analogin pin, represented as an unsigned 16bit value 00055 * 00056 * @param obj The analogin object 00057 * @return An unsigned 16bit value representing the current input voltage 00058 */ 00059 uint16_t analogin_read_u16(analogin_t *obj); 00060 00061 /**@}*/ 00062 00063 #ifdef __cplusplus 00064 } 00065 #endif 00066 00067 #endif 00068 00069 #endif 00070 00071 /** @}*/
Generated on Tue Jul 12 2022 17:38:47 by
