1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\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
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
14 * -------------------------------- Arctic Core ------------------------------*/
\r
18 #ifndef NVM_CONFIG_TYPES_H_
\r
19 #define NVM_CONFIG_TYPES_H_
\r
21 #include "NvM_Types.h"
\r
23 /* NvM_ApiConfigClassType */ /** @req NVM491 */
\r
24 #define NVM_API_CONFIG_CLASS_1 0
\r
25 #define NVM_API_CONFIG_CLASS_2 1
\r
26 #define NVM_API_CONFIG_CLASS_3 2
\r
31 } Nvm_BlockCRCTypeType;
\r
35 NVM_BLOCK_REDUNDANT,
\r
37 } NvM_BlockManagementTypeType;
\r
40 * Callback function prototypes
\r
43 typedef Std_ReturnType (*NvM_SingleBlockCallbackFunctionType)(uint8 ServiceId, NvM_RequestResultType JobResult); /** @req NVM467 */
\r
44 typedef void (*NvM_MultiBlockCallbackFunctionType)(uint8 ServiceId, NvM_RequestResultType JobResult); /** @req NVM468 */
\r
45 typedef Std_ReturnType (*NvM_InitBlockCallbackFunctionType)(void); /** @req NVM469 */
\r
48 * Containers and configuration parameters
52 NvM_MultiBlockCallbackFunctionType MultiBlockCallback; /** @req NVM500 */
\r
53 // The rest of the parameters is realized in NvM_Cfg.h
\r
56 #if 0 // Currently not used
\r
58 // ??? EaRef; // TODO: Check this
\r
59 // ??? FeeRef; // TODO: Check this
\r
60 } NvM_TargetBlockReferenceType;
\r
64 // NVRAM block global settings
\r
65 uint16 NvramBlockIdentifier; /** @req 3.1.5|NVM481 */ // TODO: Remove? Not needed if block nr correspond to array index.
\r
66 NvM_BlockManagementTypeType BlockManagementType; /** @req 3.1.5|NVM062 */
\r
67 uint8 BlockJobPriority; /** @req 3.1.5|NVM477 */
\r
68 boolean BlockWriteProt; /** @req 3.1.5|NVM033 */
\r
69 boolean WriteBlockOnce; /** @req 3.1.5|NVM072 */
\r
70 boolean SelectBlockForReadall; /** @req 3.1.5|NVM117 *//** @req 3.1.5|NVM245 */
\r
71 boolean ResistantToChangesSw; /** @req 3.1.5|NVM483 */
\r
72 NvM_SingleBlockCallbackFunctionType SingleBlockCallback;
\r
73 uint16 NvBlockLength; /** @req 3.1.5|NVM479 */ // TODO: Check this
\r
75 // CRC usage of RAM and NV blocks
\r
76 boolean BlockUseCrc; /** @req 3.1.5|NVM036 */
\r
77 Nvm_BlockCRCTypeType BlockCRCType; /** @req 3.1.5|NVM476 */
\r
79 // RAM block, RamBlockDataAddress == NULL means temporary block otherwise permanent block
\r
80 uint8 *RamBlockDataAddress; /** @req 3.1.5|NVM482 */
\r
81 boolean CalcRamBlockCrc; /** @req 3.1.5|NVM119 */
\r
83 // NV block, FEE/EA references
\r
84 uint8 NvBlockNum; /** @req 3.1.5|NVM480 */
\r
85 uint32 NvramDeviceId; /** @req 3.1.5|NVM035 */
\r
86 uint16 NvBlockBaseNumber; /** @req 3.1.5|NVM478 */
\r
88 // ROM block, reference, if RomBlockDataAdress == NULL no ROM data is available
\r
89 uint16 RomBlockNum; /** @req 3.1.5|NVM485 */
\r
90 uint8 *RomBlockDataAdress; /** @req 3.1.5|NVM484 */
\r
91 NvM_InitBlockCallbackFunctionType InitBlockCallback; /** @req 3.1.5|NVM116 */
\r
94 #if 0 // Currently not used
\r
95 NvM_TargetBlockReferenceType TargetBlockReference; /** @req NVM486 */
\r
97 } NvM_BlockDescriptorType; /** @req NVM061 */
\r
101 NvM_CommonType Common; // 1
\r
102 const NvM_BlockDescriptorType *BlockDescriptor; // 1..65536
\r
106 * Make the NvM_Config visible for others.
\r
108 extern const NvM_ConfigType NvM_Config;
\r
113 #endif /*NVM_CONFIG_TYPES_H_*/
\r