temp

Dependencies:   mbed SDFileSystem MS5607 ADXL345_I2C FATFileSystem

Committer:
IKobayashi
Date:
Mon Mar 16 23:37:42 2020 +0900
Revision:
0:c88c3b616c00
copy

Who changed what in which revision?

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