Skip to content

Commit 5c60eb6

Browse files
committed
Merge pull request #1867 from rgrover/master
introduce the CMSIS Storage driver and its implementation for K64F
2 parents c9a15d0 + 00feaa0 commit 5c60eb6

File tree

4 files changed

+1863
-1
lines changed

4 files changed

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

0 commit comments

Comments
 (0)