]> rtime.felk.cvut.cz Git - arc.git/blob - include/Eep.h
Merge with hcs12_mcal
[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 \r
17 \r
18 \r
19 \r
20 \r
21 \r
22 \r
23 #ifndef EEP_H_\r
24 #define EEP_H_\r
25 \r
26 #include "Std_Types.h"\r
27 #include "MemIf_Types.h"\r
28 \r
29 /* Standard info */\r
30 #define EEP_VENDOR_ID             1\r
31 #define EEP_MODULE_ID                                            MODULE_ID_EEP\r
32 #define EEP_SW_MAJOR_VERSION      1\r
33 #define EEP_SW_MINOR_VERSION      0\r
34 #define EEP_SW_PATCH_VERSION      1\r
35 #define EEP_AR_MAJOR_VERSION      2\r
36 #define EEP_AR_MINOR_VERSION      2\r
37 #define EEP_AR_PATCH_VERSION      1\r
38 \r
39 typedef uint32 Eep_AddressType;\r
40 typedef Eep_AddressType Eep_LengthType;\r
41 \r
42 /* Development errors */\r
43 // API parameter checking\r
44 #define EEP_E_PARAM_CONFIG                      0x10\r
45 #define EEP_E_PARAM_ADDRESS                     0x11\r
46 #define EEP_E_PARAM_DATA                          0x12\r
47 #define EEP_E_PARAM_LENGTH                      0x13\r
48 // EEPROM state checking\r
49 #define EEP_E_UNINIT                                0x20\r
50 #define EEP_E_BUSY                                          0x21\r
51 \r
52 /* Service id's for fls functions */\r
53 #define EEP_INIT_ID                                         0x00\r
54 #define EEP_SETMODE_ID          0x01\r
55 #define EEP_READ_ID             0x02\r
56 #define EEP_WRITE_ID            0x03\r
57 #define EEP_ERASE_ID            0x04\r
58 #define EEP_COMPARE_ID          0x05\r
59 #define EEP_CANCEL_ID           0x06\r
60 #define EEP_GETSTATUS_ID        0x07\r
61 #define EEP_GETJOBSTATUS_ID     0x08\r
62 #define EEP_GETVERSIONINFO_ID   0x0A\r
63 \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