mbed-os for GR-LYCHEE

Dependents:   mbed-os-example-blinky-gr-lychee GR-Boads_Camera_sample GR-Boards_Audio_Recoder GR-Boads_Camera_DisplayApp ... more

Committer:
dkato
Date:
Fri Feb 02 05:42:23 2018 +0000
Revision:
0:f782d9c66c49
mbed-os for GR-LYCHEE

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dkato 0:f782d9c66c49 1
dkato 0:f782d9c66c49 2 /** \addtogroup hal */
dkato 0:f782d9c66c49 3 /** @{*/
dkato 0:f782d9c66c49 4 /* mbed Microcontroller Library
dkato 0:f782d9c66c49 5 * Copyright (c) 2006-2013 ARM Limited
dkato 0:f782d9c66c49 6 *
dkato 0:f782d9c66c49 7 * Licensed under the Apache License, Version 2.0 (the "License");
dkato 0:f782d9c66c49 8 * you may not use this file except in compliance with the License.
dkato 0:f782d9c66c49 9 * You may obtain a copy of the License at
dkato 0:f782d9c66c49 10 *
dkato 0:f782d9c66c49 11 * http://www.apache.org/licenses/LICENSE-2.0
dkato 0:f782d9c66c49 12 *
dkato 0:f782d9c66c49 13 * Unless required by applicable law or agreed to in writing, software
dkato 0:f782d9c66c49 14 * distributed under the License is distributed on an "AS IS" BASIS,
dkato 0:f782d9c66c49 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dkato 0:f782d9c66c49 16 * See the License for the specific language governing permissions and
dkato 0:f782d9c66c49 17 * limitations under the License.
dkato 0:f782d9c66c49 18 */
dkato 0:f782d9c66c49 19 #ifndef MBED_ANALOGIN_API_H
dkato 0:f782d9c66c49 20 #define MBED_ANALOGIN_API_H
dkato 0:f782d9c66c49 21
dkato 0:f782d9c66c49 22 #include "device.h"
dkato 0:f782d9c66c49 23
dkato 0:f782d9c66c49 24 #if DEVICE_ANALOGIN
dkato 0:f782d9c66c49 25
dkato 0:f782d9c66c49 26 #ifdef __cplusplus
dkato 0:f782d9c66c49 27 extern "C" {
dkato 0:f782d9c66c49 28 #endif
dkato 0:f782d9c66c49 29
dkato 0:f782d9c66c49 30 /** Analogin hal structure. analogin_s is declared in the target's hal
dkato 0:f782d9c66c49 31 */
dkato 0:f782d9c66c49 32 typedef struct analogin_s analogin_t;
dkato 0:f782d9c66c49 33
dkato 0:f782d9c66c49 34 /**
dkato 0:f782d9c66c49 35 * \defgroup hal_analogin Analogin hal functions
dkato 0:f782d9c66c49 36 * @{
dkato 0:f782d9c66c49 37 */
dkato 0:f782d9c66c49 38
dkato 0:f782d9c66c49 39 /** Initialize the analogin peripheral
dkato 0:f782d9c66c49 40 *
dkato 0:f782d9c66c49 41 * Configures the pin used by analogin.
dkato 0:f782d9c66c49 42 * @param obj The analogin object to initialize
dkato 0:f782d9c66c49 43 * @param pin The analogin pin name
dkato 0:f782d9c66c49 44 */
dkato 0:f782d9c66c49 45 void analogin_init(analogin_t *obj, PinName pin);
dkato 0:f782d9c66c49 46
dkato 0:f782d9c66c49 47 /** Read the input voltage, represented as a float in the range [0.0, 1.0]
dkato 0:f782d9c66c49 48 *
dkato 0:f782d9c66c49 49 * @param obj The analogin object
dkato 0:f782d9c66c49 50 * @return A floating value representing the current input voltage
dkato 0:f782d9c66c49 51 */
dkato 0:f782d9c66c49 52 float analogin_read(analogin_t *obj);
dkato 0:f782d9c66c49 53
dkato 0:f782d9c66c49 54 /** Read the value from analogin pin, represented as an unsigned 16bit value
dkato 0:f782d9c66c49 55 *
dkato 0:f782d9c66c49 56 * @param obj The analogin object
dkato 0:f782d9c66c49 57 * @return An unsigned 16bit value representing the current input voltage
dkato 0:f782d9c66c49 58 */
dkato 0:f782d9c66c49 59 uint16_t analogin_read_u16(analogin_t *obj);
dkato 0:f782d9c66c49 60
dkato 0:f782d9c66c49 61 /**@}*/
dkato 0:f782d9c66c49 62
dkato 0:f782d9c66c49 63 #ifdef __cplusplus
dkato 0:f782d9c66c49 64 }
dkato 0:f782d9c66c49 65 #endif
dkato 0:f782d9c66c49 66
dkato 0:f782d9c66c49 67 #endif
dkato 0:f782d9c66c49 68
dkato 0:f782d9c66c49 69 #endif
dkato 0:f782d9c66c49 70
dkato 0:f782d9c66c49 71 /** @}*/