Greg Steiert / maxim_dev

Dependents:   sensomed

Committer:
switches
Date:
Tue Nov 08 18:27:11 2016 +0000
Revision:
0:0e018d759a2a
Initial commit

Who changed what in which revision?

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