]> begriffs open source - cmsis/blob - CMSIS/Driver/DriverTemplates/Driver_Storage.c
Updated WiFi Driver API 1.0.0-beta
[cmsis] / CMSIS / Driver / DriverTemplates / Driver_Storage.c
1 /*
2  * Copyright (c) 2013-2018 Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Licensed under the Apache License, Version 2.0 (the License); you may
7  * not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19
20 #include "Driver_Storage.h"
21
22 #define ARM_STORAGE_DRV_VERSION    ARM_DRIVER_VERSION_MAJOR_MINOR(1, 0) /* driver version */
23
24 /* Driver Version */
25 static const ARM_DRIVER_VERSION DriverVersion = {
26     ARM_STORAGE_API_VERSION,
27     ARM_STORAGE_DRV_VERSION
28 };
29
30 /* Driver Capabilities */
31 static const ARM_STORAGE_CAPABILITIES DriverCapabilities = {
32     1,  /* Asynchronous Mode */
33     1,  /* Supports EraseAll operation */
34     0   /* Reserved */
35 };
36
37
38 //
39 // Functions
40 //
41
42 ARM_DRIVER_VERSION ARM_Storage_GetVersion (void)  {
43 }
44
45 ARM_STORAGE_CAPABILITIES ARM_Storage_GetCapabilities (void)  {
46 }
47
48 int32_t ARM_Storage_Initialize (ARM_Storage_Callback_t callback)  {
49 }
50
51 int32_t ARM_Storage_Uninitialize (void)  {
52 }
53
54 int32_t ARM_Storage_PowerControl (ARM_POWER_STATE state)
55 {
56     switch (state)
57     {
58     case ARM_POWER_OFF:
59         break;
60
61     case ARM_POWER_LOW:
62         break;
63
64     case ARM_POWER_FULL:
65         break;
66
67     default:
68         return ARM_DRIVER_ERROR_UNSUPPORTED;
69     }
70 }
71
72 int32_t ARM_Storage_ReadData (uint64_t addr, void *data, uint32_t size)  {
73 }
74
75 int32_t ARM_Storage_ProgramData (uint64_t addr, const void *data, uint32_t size)  {
76 }
77
78 int32_t ARM_Storage_Erase (uint64_t addr, uint32_t size)  {
79 }
80
81 int32_t ARM_Storage_EraseAll (void)  {
82 }
83
84 ARM_STORAGE_STATUS ARM_Storage_GetStatus (void)  {
85 }
86
87 int32_t ARM_Storage_GetInfo (ARM_STORAGE_INFO *info)  {
88 }
89
90 uint32_t ARM_Storage_ResolveAddress(uint64_t addr) {
91 }
92
93 int32_t ARM_Storage_GetNextBlock(const ARM_STORAGE_BLOCK* prev_block, ARM_STORAGE_BLOCK *next_block) {
94 }
95
96 int32_t ARM_Storage_GetBlock(uint64_t addr, ARM_STORAGE_BLOCK *block) {
97 }
98 // End Storage Interface
99
100 ARM_DRIVER_STORAGE Driver_STORAGE = {
101     ARM_Storage_GetVersion,
102     ARM_Storage_GetCapabilities,
103     ARM_Storage_Initialize,
104     ARM_Storage_Uninitialize,
105     ARM_Storage_PowerControl,
106     ARM_Storage_ReadData,
107     ARM_Storage_ProgramData,
108     ARM_Storage_Erase,
109     ARM_Storage_EraseAll,
110     ARM_Storage_GetStatus,
111     ARM_Storage_GetInfo,
112     ARM_Storage_ResolveAddress,
113     ARM_Storage_GetNextBlock,
114     ARM_Storage_GetBlock
115 };