aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/ext/mcux-sdk/CMSIS/Driver/DriverTemplates/Driver_Flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/CMSIS/Driver/DriverTemplates/Driver_Flash.c')
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/CMSIS/Driver/DriverTemplates/Driver_Flash.c137
1 files changed, 137 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/CMSIS/Driver/DriverTemplates/Driver_Flash.c b/lib/chibios-contrib/ext/mcux-sdk/CMSIS/Driver/DriverTemplates/Driver_Flash.c
new file mode 100644
index 000000000..0f221da5f
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/CMSIS/Driver/DriverTemplates/Driver_Flash.c
@@ -0,0 +1,137 @@
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#include "Driver_Flash.h"
20
21#define ARM_FLASH_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(1, 0) /* driver version */
22
23/* Sector Information */
24#ifdef FLASH_SECTORS
25static ARM_FLASH_SECTOR FLASH_SECTOR_INFO[FLASH_SECTOR_COUNT] = {
26 FLASH_SECTORS
27};
28#else
29#define FLASH_SECTOR_INFO NULL
30#endif
31
32/* Flash Information */
33static ARM_FLASH_INFO FlashInfo = {
34 0, /* FLASH_SECTOR_INFO */
35 0, /* FLASH_SECTOR_COUNT */
36 0, /* FLASH_SECTOR_SIZE */
37 0, /* FLASH_PAGE_SIZE */
38 0, /* FLASH_PROGRAM_UNIT */
39 0 /* FLASH_ERASED_VALUE */
40};
41
42/* Flash Status */
43static ARM_FLASH_STATUS FlashStatus;
44
45/* Driver Version */
46static const ARM_DRIVER_VERSION DriverVersion = {
47 ARM_FLASH_API_VERSION,
48 ARM_FLASH_DRV_VERSION
49};
50
51/* Driver Capabilities */
52static const ARM_FLASH_CAPABILITIES DriverCapabilities = {
53 0, /* event_ready */
54 0, /* data_width = 0:8-bit, 1:16-bit, 2:32-bit */
55 0 /* erase_chip */
56};
57
58//
59// Functions
60//
61
62ARM_DRIVER_VERSION ARM_Flash_GetVersion(void)
63{
64}
65
66ARM_FLASH_CAPABILITIES ARM_Flash_GetCapabilities(void)
67{
68}
69
70int32_t ARM_Flash_Initialize(ARM_Flash_SignalEvent_t cb_event)
71{
72}
73
74int32_t ARM_Flash_Uninitialize(void)
75{
76}
77
78int32_t ARM_Flash_PowerControl(ARM_POWER_STATE state)
79{
80 switch (state)
81 {
82 case ARM_POWER_OFF:
83 break;
84
85 case ARM_POWER_LOW:
86 break;
87
88 case ARM_POWER_FULL:
89 break;
90
91 default:
92 return ARM_DRIVER_ERROR_UNSUPPORTED;
93 }
94}
95
96int32_t ARM_Flash_ReadData(uint32_t addr, void *data, uint32_t cnt)
97{
98}
99
100int32_t ARM_Flash_ProgramData(uint32_t addr, const void *data, uint32_t cnt)
101{
102}
103
104int32_t ARM_Flash_EraseSector(uint32_t addr)
105{
106}
107
108int32_t ARM_Flash_EraseChip(void)
109{
110}
111
112ARM_FLASH_STATUS ARM_Flash_GetStatus(void)
113{
114}
115
116ARM_FLASH_INFO * ARM_Flash_GetInfo(void)
117{
118}
119
120void ARM_Flash_SignalEvent(uint32_t event)
121{
122}
123// End Flash Interface
124
125ARM_DRIVER_FLASH Driver_FLASH = {
126 ARM_Flash_GetVersion,
127 ARM_Flash_GetCapabilities,
128 ARM_Flash_Initialize,
129 ARM_Flash_Uninitialize,
130 ARM_Flash_PowerControl,
131 ARM_Flash_ReadData,
132 ARM_Flash_ProgramData,
133 ARM_Flash_EraseSector,
134 ARM_Flash_EraseChip,
135 ARM_Flash_GetStatus,
136 ARM_Flash_GetInfo
137}; \ No newline at end of file