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_PWMOUT_API_H
MACRUM 6:40e873bbc5f7 20 #define MBED_PWMOUT_API_H
MACRUM 6:40e873bbc5f7 21
MACRUM 6:40e873bbc5f7 22 #include "device.h"
MACRUM 6:40e873bbc5f7 23
MACRUM 6:40e873bbc5f7 24 #if DEVICE_PWMOUT
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 /** Pwmout hal structure. pwmout_s is declared in the target's hal
MACRUM 6:40e873bbc5f7 31 */
MACRUM 6:40e873bbc5f7 32 typedef struct pwmout_s pwmout_t;
MACRUM 6:40e873bbc5f7 33
MACRUM 6:40e873bbc5f7 34 /**
MACRUM 6:40e873bbc5f7 35 * \defgroup hal_pwmout Pwmout hal functions
MACRUM 6:40e873bbc5f7 36 * @{
MACRUM 6:40e873bbc5f7 37 */
MACRUM 6:40e873bbc5f7 38
MACRUM 6:40e873bbc5f7 39 /** Initialize the pwm out peripheral and configure the pin
MACRUM 6:40e873bbc5f7 40 *
MACRUM 6:40e873bbc5f7 41 * @param obj The pwmout object to initialize
MACRUM 6:40e873bbc5f7 42 * @param pin The pwmout pin to initialize
MACRUM 6:40e873bbc5f7 43 */
MACRUM 6:40e873bbc5f7 44 void pwmout_init(pwmout_t *obj, PinName pin);
MACRUM 6:40e873bbc5f7 45
MACRUM 6:40e873bbc5f7 46 /** Deinitialize the pwmout object
MACRUM 6:40e873bbc5f7 47 *
MACRUM 6:40e873bbc5f7 48 * @param obj The pwmout object
MACRUM 6:40e873bbc5f7 49 */
MACRUM 6:40e873bbc5f7 50 void pwmout_free(pwmout_t *obj);
MACRUM 6:40e873bbc5f7 51
MACRUM 6:40e873bbc5f7 52 /** Set the output duty-cycle in range <0.0f, 1.0f>
MACRUM 6:40e873bbc5f7 53 *
MACRUM 6:40e873bbc5f7 54 * Value 0.0f represents 0 percentage, 1.0f represents 100 percent.
MACRUM 6:40e873bbc5f7 55 * @param obj The pwmout object
MACRUM 6:40e873bbc5f7 56 * @param percent The floating-point percentage number
MACRUM 6:40e873bbc5f7 57 */
MACRUM 6:40e873bbc5f7 58 void pwmout_write(pwmout_t *obj, float percent);
MACRUM 6:40e873bbc5f7 59
MACRUM 6:40e873bbc5f7 60 /** Read the current float-point output duty-cycle
MACRUM 6:40e873bbc5f7 61 *
MACRUM 6:40e873bbc5f7 62 * @param obj The pwmout object
MACRUM 6:40e873bbc5f7 63 * @return A floating-point output duty-cycle
MACRUM 6:40e873bbc5f7 64 */
MACRUM 6:40e873bbc5f7 65 float pwmout_read(pwmout_t *obj);
MACRUM 6:40e873bbc5f7 66
MACRUM 6:40e873bbc5f7 67 /** Set the PWM period specified in seconds, keeping the duty cycle the same
MACRUM 6:40e873bbc5f7 68 *
MACRUM 6:40e873bbc5f7 69 * Periods smaller than microseconds (the lowest resolution) are set to zero.
MACRUM 6:40e873bbc5f7 70 * @param obj The pwmout object
MACRUM 6:40e873bbc5f7 71 * @param seconds The floating-point seconds period
MACRUM 6:40e873bbc5f7 72 */
MACRUM 6:40e873bbc5f7 73 void pwmout_period(pwmout_t *obj, float seconds);
MACRUM 6:40e873bbc5f7 74
MACRUM 6:40e873bbc5f7 75 /** Set the PWM period specified in miliseconds, keeping the duty cycle the same
MACRUM 6:40e873bbc5f7 76 *
MACRUM 6:40e873bbc5f7 77 * @param obj The pwmout object
MACRUM 6:40e873bbc5f7 78 * @param ms The milisecond period
MACRUM 6:40e873bbc5f7 79 */
MACRUM 6:40e873bbc5f7 80 void pwmout_period_ms(pwmout_t *obj, int ms);
MACRUM 6:40e873bbc5f7 81
MACRUM 6:40e873bbc5f7 82 /** Set the PWM period specified in microseconds, keeping the duty cycle the same
MACRUM 6:40e873bbc5f7 83 *
MACRUM 6:40e873bbc5f7 84 * @param obj The pwmout object
MACRUM 6:40e873bbc5f7 85 * @param us The microsecond period
MACRUM 6:40e873bbc5f7 86 */
MACRUM 6:40e873bbc5f7 87 void pwmout_period_us(pwmout_t *obj, int us);
MACRUM 6:40e873bbc5f7 88
MACRUM 6:40e873bbc5f7 89 /** Set the PWM pulsewidth specified in seconds, keeping the period the same.
MACRUM 6:40e873bbc5f7 90 *
MACRUM 6:40e873bbc5f7 91 * @param obj The pwmout object
MACRUM 6:40e873bbc5f7 92 * @param seconds The floating-point pulsewidth in seconds
MACRUM 6:40e873bbc5f7 93 */
MACRUM 6:40e873bbc5f7 94 void pwmout_pulsewidth(pwmout_t *obj, float seconds);
MACRUM 6:40e873bbc5f7 95
MACRUM 6:40e873bbc5f7 96 /** Set the PWM pulsewidth specified in miliseconds, keeping the period the same.
MACRUM 6:40e873bbc5f7 97 *
MACRUM 6:40e873bbc5f7 98 * @param obj The pwmout object
MACRUM 6:40e873bbc5f7 99 * @param ms The floating-point pulsewidth in miliseconds
MACRUM 6:40e873bbc5f7 100 */
MACRUM 6:40e873bbc5f7 101 void pwmout_pulsewidth_ms(pwmout_t *obj, int ms);
MACRUM 6:40e873bbc5f7 102
MACRUM 6:40e873bbc5f7 103 /** Set the PWM pulsewidth specified in microseconds, keeping the period the same.
MACRUM 6:40e873bbc5f7 104 *
MACRUM 6:40e873bbc5f7 105 * @param obj The pwmout object
MACRUM 6:40e873bbc5f7 106 * @param us The floating-point pulsewidth in microseconds
MACRUM 6:40e873bbc5f7 107 */
MACRUM 6:40e873bbc5f7 108 void pwmout_pulsewidth_us(pwmout_t *obj, int us);
MACRUM 6:40e873bbc5f7 109
MACRUM 6:40e873bbc5f7 110 /**@}*/
MACRUM 6:40e873bbc5f7 111
MACRUM 6:40e873bbc5f7 112 #ifdef __cplusplus
MACRUM 6:40e873bbc5f7 113 }
MACRUM 6:40e873bbc5f7 114 #endif
MACRUM 6:40e873bbc5f7 115
MACRUM 6:40e873bbc5f7 116 #endif
MACRUM 6:40e873bbc5f7 117
MACRUM 6:40e873bbc5f7 118 #endif
MACRUM 6:40e873bbc5f7 119
MACRUM 6:40e873bbc5f7 120 /** @}*/