]> rtime.felk.cvut.cz Git - arc.git/blob - include/Eep.h
Regenerated examples. Removed linux board. Added default cross compiler for TI.
[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 \r
22 /* Standard info */\r
23 #define EEP_VENDOR_ID             1\r
24 #define EEP_MODULE_ID                                            MODULE_ID_EEP\r
25 #define EEP_SW_MAJOR_VERSION      1\r
26 #define EEP_SW_MINOR_VERSION      0\r
27 #define EEP_SW_PATCH_VERSION      1\r
28 #define EEP_AR_MAJOR_VERSION      2\r
29 #define EEP_AR_MINOR_VERSION      2\r
30 #define EEP_AR_PATCH_VERSION      1\r
31 \r
32 typedef uint32 Eep_AddressType;\r
33 typedef Eep_AddressType Eep_LengthType;\r
34 \r
35 /* Development errors */\r
36 // API parameter checking\r
37 #define EEP_E_PARAM_CONFIG                      0x10\r
38 #define EEP_E_PARAM_ADDRESS                     0x11\r
39 #define EEP_E_PARAM_DATA                          0x12\r
40 #define EEP_E_PARAM_LENGTH                      0x13\r
41 #define EEP_E_PARAM_POINTER                     0x23\r
42 \r
43 // EEPROM state checking\r
44 #define EEP_E_UNINIT                                0x20\r
45 #define EEP_E_BUSY                                          0x21\r
46 #define EEP_E_TIMEOUT                                   0x22\r
47 \r
48 \r
49 /* Production errors */\r
50 // #define EEP_E_COM_FAILURE       0x30 /* Shall be located in DemIntErrId.h when its available */\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 #include "Eep_Cfg.h"\r
65 \r
66 void Eep_Init( const Eep_ConfigType *ConfigPtr );\r
67 Std_ReturnType Eep_Erase(       Eep_AddressType   EepromAddress,\r
68                                         Eep_LengthType    Length );\r
69 \r
70 \r
71 Std_ReturnType Eep_Write (    Eep_AddressType   EepromAddress,\r
72                                           const uint8         *SourceAddressPtr,\r
73                                           Eep_LengthType    Length );\r
74 \r
75 void Eep_Cancel( void );\r
76 MemIf_StatusType        Eep_GetStatus(  void );\r
77 MemIf_JobResultType Eep_GetJobResult( void );\r
78 \r
79 void Eep_MainFunction( void );\r
80 \r
81 Std_ReturnType Eep_Read (       Eep_AddressType EepromAddress,\r
82                                                         uint8 *TargetAddressPtr,\r
83                                                         Eep_LengthType Length );\r
84 \r
85 Std_ReturnType Eep_Compare( Eep_AddressType EepromAddress,\r
86                                                         uint8 *TargetAddressPtr,\r
87                                                         Eep_LengthType Length );\r
88 \r
89 void Eep_SetMode( MemIf_ModeType Mode );\r
90 \r
91 #if ( EEP_VERSION_INFO_API == STD_ON )\r
92 #define Eep_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,EEP)\r
93 #endif\r
94 \r
95 #endif /*EEP_H_*/\r