]> rtime.felk.cvut.cz Git - arc.git/blob - memory/NvM/Nvm_ServiceComponent.c
changed unimplemented services to return E_NOT_OK
[arc.git] / memory / NvM / Nvm_ServiceComponent.c
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\r
6  * This source code is free software; you can redistribute it and/or modify it\r
7  * under the terms of the GNU General Public License version 2 as published by the\r
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
9  *\r
10  * This program is distributed in the hope that it will be useful, but\r
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 #include "NvM.h"\r
17 \r
18 #if defined(CFG_NVM_USE_SERVICE_COMPONENT)\r
19 \r
20 Std_ReturnType NvMService_GetErrorStatus(NvM_BlockIdType BlockId, NvM_RequestResultType* RequestResultPtr) {\r
21         NvM_GetErrorStatus( BlockId, (uint8*)RequestResultPtr );\r
22         return E_OK;\r
23 }\r
24 \r
25 #if (NVM_SET_RAM_BLOCK_STATUS_API == STD_ON )\r
26 Std_ReturnType NvMService_SetRamBlockStatus(NvM_BlockIdType BlockId, Boolean BlockChanged) {\r
27         NvM_SetRamBlockStatus( BlockId, (boolean)BlockChanged );\r
28         return E_OK;\r
29 }\r
30 #endif\r
31 \r
32 #if (NVM_API_CONFIG_CLASS > NVM_API_CONFIG_CLASS_1)\r
33 \r
34 Std_ReturnType NvMService_SetDataIndex(NvM_BlockIdType BlockId, UInt8 DataIndex) {\r
35         NvM_SetDataIndex( BlockId, (uint8)DataIndex );\r
36         return E_OK;\r
37 }\r
38 \r
39 Std_ReturnType NvMService_GetDataIndex(NvM_BlockIdType BlockId, UInt8* DataIndexPtr) {\r
40         NvM_GetDataIndex( BlockId, (uint8*)DataIndexPtr );\r
41         return E_OK;\r
42 }\r
43 \r
44 Std_ReturnType NvMService_ReadBlock(NvM_BlockIdType BlockId, const DstPtrType DstPtr) {\r
45         return NvM_ReadBlock(BlockId, (uint8*)DstPtr), E_OK;\r
46 }\r
47 \r
48 Std_ReturnType NvMService_WriteBlock(NvM_BlockIdType BlockId, const DstPtrType SrcPtr) {\r
49         return NvM_WriteBlock( BlockId, (uint8*)(SrcPtr) ), E_OK;\r
50 }\r
51 \r
52 Std_ReturnType NvMService_RestoreBlockDefaults(NvM_BlockIdType BlockId, const DstPtrType DstPtr) {\r
53         return NvM_RestoreBlockDefaults( BlockId, (uint8*)DstPtr ), E_OK;\r
54 }\r
55 \r
56 #else\r
57 \r
58 Std_ReturnType NvMService_SetDataIndex(NvM_BlockIdType BlockId, UInt8 DataIndex) {\r
59         /* Dummy */\r
60         return E_NOT_OK;\r
61 }\r
62 \r
63 Std_ReturnType NvMService_GetDataIndex(NvM_BlockIdType BlockId, UInt8* DataIndexPtr) {\r
64         /* Dummy */\r
65         return E_NOT_OK;\r
66 }\r
67 \r
68 Std_ReturnType NvMService_ReadBlock(NvM_BlockIdType BlockId, const DstPtrType DstPtr) {\r
69         /* Dummy */\r
70         return E_NOT_OK;\r
71 }\r
72 \r
73 Std_ReturnType NvMService_WriteBlock(NvM_BlockIdType BlockId, const DstPtrType SrcPtr) {\r
74         /* Dummy */\r
75         return NvM_WriteBlock(BlockId, (const uint8*) SrcPtr);\r
76 }\r
77 \r
78 Std_ReturnType NvMService_RestoreBlockDefaults(NvM_BlockIdType BlockId, const DstPtrType DstPtr) {\r
79         /* Dummy */\r
80         return E_NOT_OK;\r
81 }\r
82 \r
83 #endif\r
84 \r
85 #if (NVM_API_CONFIG_CLASS > NVM_API_CONFIG_CLASS_2)\r
86 \r
87 Std_ReturnType NvMService_EraseBlock(NvM_BlockIdType BlockId) {\r
88         return NvM_EraseNvBlock( BlockId );\r
89 }\r
90 \r
91 Std_ReturnType NvMService_InvalidateNvBlock(NvM_BlockIdType BlockId) {\r
92         return NvM_InvalidateNvBlock( BlockId );\r
93 }\r
94 \r
95 Std_ReturnType NvMAdmin_SetBlockProtection(NvM_BlockIdType BlockId, Boolean ProtectionEnabled) {\r
96         NvM_SetBlockProtection( BlockId, (boolean)(ProtectionEnabled) );\r
97         return E_OK;\r
98 }\r
99 \r
100 #else\r
101 \r
102 Std_ReturnType NvMService_EraseBlock(NvM_BlockIdType BlockId) {\r
103         /* Dummy */\r
104         return E_NOT_OK;\r
105 }\r
106 \r
107 Std_ReturnType NvMService_InvalidateNvBlock(NvM_BlockIdType BlockId) {\r
108         /* Dummy */\r
109         return E_NOT_OK;\r
110 }\r
111 \r
112 Std_ReturnType NvMAdmin_SetBlockProtection(NvM_BlockIdType BlockId, Boolean ProtectionEnabled) {\r
113         /* Dummy */\r
114         return E_NOT_OK;\r
115 }\r
116 \r
117 #endif\r
118 \r
119 #endif /* CFG_NVM_USE_SERVICE_COMPONENT */\r