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 /*
MACRUM 6:40e873bbc5f7 5 * Copyright (c) 2006-2016, ARM Limited, All Rights Reserved
MACRUM 6:40e873bbc5f7 6 * SPDX-License-Identifier: Apache-2.0
MACRUM 6:40e873bbc5f7 7 *
MACRUM 6:40e873bbc5f7 8 * Licensed under the Apache License, Version 2.0 (the "License"); you may
MACRUM 6:40e873bbc5f7 9 * not use this file except in compliance with the License.
MACRUM 6:40e873bbc5f7 10 * You may obtain a copy of the License at
MACRUM 6:40e873bbc5f7 11 *
MACRUM 6:40e873bbc5f7 12 * http://www.apache.org/licenses/LICENSE-2.0
MACRUM 6:40e873bbc5f7 13 *
MACRUM 6:40e873bbc5f7 14 * Unless required by applicable law or agreed to in writing, software
MACRUM 6:40e873bbc5f7 15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
MACRUM 6:40e873bbc5f7 16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
MACRUM 6:40e873bbc5f7 17 * See the License for the specific language governing permissions and
MACRUM 6:40e873bbc5f7 18 * limitations under the License.
MACRUM 6:40e873bbc5f7 19 */
MACRUM 6:40e873bbc5f7 20
MACRUM 6:40e873bbc5f7 21 #ifndef __DRIVER_COMMON_H
MACRUM 6:40e873bbc5f7 22 #define __DRIVER_COMMON_H
MACRUM 6:40e873bbc5f7 23
MACRUM 6:40e873bbc5f7 24 #include <stddef.h>
MACRUM 6:40e873bbc5f7 25 #include <stdint.h>
MACRUM 6:40e873bbc5f7 26 #include <stdbool.h>
MACRUM 6:40e873bbc5f7 27
MACRUM 6:40e873bbc5f7 28 #define ARM_DRIVER_VERSION_MAJOR_MINOR(major,minor) (((major) << 8) | (minor))
MACRUM 6:40e873bbc5f7 29
MACRUM 6:40e873bbc5f7 30 /**
MACRUM 6:40e873bbc5f7 31 \brief Driver Version
MACRUM 6:40e873bbc5f7 32 */
MACRUM 6:40e873bbc5f7 33 typedef struct _ARM_DRIVER_VERSION {
MACRUM 6:40e873bbc5f7 34 uint16_t api; ///< API version
MACRUM 6:40e873bbc5f7 35 uint16_t drv; ///< Driver version
MACRUM 6:40e873bbc5f7 36 } ARM_DRIVER_VERSION;
MACRUM 6:40e873bbc5f7 37
MACRUM 6:40e873bbc5f7 38 /* General return codes */
MACRUM 6:40e873bbc5f7 39 #define ARM_DRIVER_OK 0 ///< Operation succeeded
MACRUM 6:40e873bbc5f7 40 #define ARM_DRIVER_ERROR -1 ///< Unspecified error
MACRUM 6:40e873bbc5f7 41 #define ARM_DRIVER_ERROR_BUSY -2 ///< Driver is busy
MACRUM 6:40e873bbc5f7 42 #define ARM_DRIVER_ERROR_TIMEOUT -3 ///< Timeout occurred
MACRUM 6:40e873bbc5f7 43 #define ARM_DRIVER_ERROR_UNSUPPORTED -4 ///< Operation not supported
MACRUM 6:40e873bbc5f7 44 #define ARM_DRIVER_ERROR_PARAMETER -5 ///< Parameter error
MACRUM 6:40e873bbc5f7 45 #define ARM_DRIVER_ERROR_SPECIFIC -6 ///< Start of driver specific errors
MACRUM 6:40e873bbc5f7 46
MACRUM 6:40e873bbc5f7 47 /**
MACRUM 6:40e873bbc5f7 48 \brief General power states
MACRUM 6:40e873bbc5f7 49 */
MACRUM 6:40e873bbc5f7 50 typedef enum _ARM_POWER_STATE {
MACRUM 6:40e873bbc5f7 51 ARM_POWER_OFF, ///< Power off: no operation possible
MACRUM 6:40e873bbc5f7 52 ARM_POWER_LOW, ///< Low Power mode: retain state, detect and signal wake-up events
MACRUM 6:40e873bbc5f7 53 ARM_POWER_FULL ///< Power on: full operation at maximum performance
MACRUM 6:40e873bbc5f7 54 } ARM_POWER_STATE;
MACRUM 6:40e873bbc5f7 55
MACRUM 6:40e873bbc5f7 56 #endif /* __DRIVER_COMMON_H */
MACRUM 6:40e873bbc5f7 57
MACRUM 6:40e873bbc5f7 58 /** @}*/