Describes predefine macros for mbed online compiler (armcc)

Committer:
MACRUM
Date:
Thu Mar 16 21:58:09 2017 +0900
Revision:
6:40e873bbc5f7
Add licence header info

Who changed what in which revision?

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