]> rtime.felk.cvut.cz Git - arc.git/blob - include/Eep.h
Correct Vendor id for all modules and upstep to AR3.1.5
[arc.git] / include / Eep.h
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 #ifndef EEP_H_\r
17 #define EEP_H_\r
18 \r
19 #include "Std_Types.h"\r
20 #include "MemIf_Types.h"\r
21 #include "Modules.h"\r
22 \r
23 /* Standard info */\r
24 #define EEP_VENDOR_ID             VENDOR_ID_ARCCORE\r
25 #define EEP_MODULE_ID                                            MODULE_ID_EEP\r
26 #define EEP_SW_MAJOR_VERSION      1\r
27 #define EEP_SW_MINOR_VERSION      0\r
28 #define EEP_SW_PATCH_VERSION      1\r
29 #define EEP_AR_MAJOR_VERSION      3\r
30 #define EEP_AR_MINOR_VERSION      1\r
31 #define EEP_AR_PATCH_VERSION      5\r
32 \r
33 typedef uint32 Eep_AddressType;\r
34 typedef Eep_AddressType Eep_LengthType;\r
35 \r
36 /* Development errors */\r
37 // API parameter checking\r
38 #define EEP_E_PARAM_CONFIG                      0x10\r
39 #define EEP_E_PARAM_ADDRESS                     0x11\r
40 #define EEP_E_PARAM_DATA                          0x12\r
41 #define EEP_E_PARAM_LENGTH                      0x13\r
42 #define EEP_E_PARAM_POINTER                     0x23\r
43 \r
44 // EEPROM state checking\r
45 #define EEP_E_UNINIT                                0x20\r
46 #define EEP_E_BUSY                                          0x21\r
47 #define EEP_E_TIMEOUT                                   0x22\r
48 \r
49 \r
50 /* Production errors */\r
51 // #define EEP_E_COM_FAILURE       0x30 /* Shall be located in DemIntErrId.h when its available */\r
52 \r
53 /* Service id's for fls functions */\r
54 #define EEP_INIT_ID                                         0x00\r
55 #define EEP_SETMODE_ID          0x01\r
56 #define EEP_READ_ID             0x02\r
57 #define EEP_WRITE_ID            0x03\r
58 #define EEP_ERASE_ID            0x04\r
59 #define EEP_COMPARE_ID          0x05\r
60 #define EEP_CANCEL_ID           0x06\r
61 #define EEP_GETSTATUS_ID        0x07\r
62 #define EEP_GETJOBSTATUS_ID     0x08\r
63 #define EEP_GETVERSIONINFO_ID   0x0A\r
64 \r
65 #include "Eep_Cfg.h"\r
66 \r
67 void Eep_Init( const Eep_ConfigType *ConfigPtr );\r
68 Std_ReturnType Eep_Erase(       Eep_AddressType   EepromAddress,\r
69                                         Eep_LengthType    Length );\r
70 \r
71 \r
72 Std_ReturnType Eep_Write (    Eep_AddressType   EepromAddress,\r
73                                           const uint8         *SourceAddressPtr,\r
74                                           Eep_LengthType    Length );\r
75 \r
76 void Eep_Cancel( void );\r
77 MemIf_StatusType        Eep_GetStatus(  void );\r
78 MemIf_JobResultType Eep_GetJobResult( void );\r
79 \r
80 void Eep_MainFunction( void );\r
81 \r
82 Std_ReturnType Eep_Read (       Eep_AddressType EepromAddress,\r
83                                                         uint8 *TargetAddressPtr,\r
84                                                         Eep_LengthType Length );\r
85 \r
86 Std_ReturnType Eep_Compare( Eep_AddressType EepromAddress,\r
87                                                         uint8 *TargetAddressPtr,\r
88                                                         Eep_LengthType Length );\r
89 \r
90 void Eep_SetMode( MemIf_ModeType Mode );\r
91 \r
92 #if ( EEP_VERSION_INFO_API == STD_ON )\r
93 #define Eep_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,EEP)\r
94 #endif\r
95 \r
96 #endif /*EEP_H_*/\r