mbed library for slider v2

Dependents:   kl46z_slider_v2

Committer:
mturner5
Date:
Wed Sep 14 07:04:27 2016 +0000
Revision:
0:b7116bd48af6
Tried to use the timer.

Who changed what in which revision?

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