guiguitant théo / greenhouse1

Dependencies:   mbed

Committer:
guiguitt
Date:
Mon May 27 20:37:26 2019 +0000
Revision:
4:336b944e9430
Parent:
0:3fc4a1072bca
correction

Who changed what in which revision?

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