Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.

Upstream: https://github.com/ARMmbed/DAPLink

Committer:
Pawel Zarembski
Date:
Tue Apr 07 12:55:42 2020 +0200
Revision:
0:01f31e923fe2
hani: DAPLink with reset workaround

Who changed what in which revision?

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