]> rtime.felk.cvut.cz Git - arc.git/blob - include/Fee.h
Merge branch 'mikulka' of git@rtime.felk.cvut.cz:arc into mikulka
[arc.git] / include / Fee.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 FEE_H_\r
24 #define FEE_H_\r
25 \r
26 \r
27 #define FEE_MODULE_ID                   MODULE_ID_FEE\r
28 #define FEE_VENDOR_ID                   1\r
29 \r
30 #define FEE_SW_MAJOR_VERSION    1\r
31 #define FEE_SW_MINOR_VERSION    0\r
32 #define FEE_SW_PATCH_VERSION    0\r
33 #define FEE_AR_MAJOR_VERSION    3\r
34 #define FEE_AR_MINOR_VERSION    0\r
35 #define FEE_AR_PATCH_VERSION    1\r
36 \r
37 #include "Std_Types.h"\r
38 #include "Fee_Cfg.h"\r
39 #include "Fls.h"\r
40 \r
41 #if (FEE_DEV_ERROR_DETECT == STD_ON)\r
42 // Error codes reported by this module defined by AUTOSAR\r
43 #define FEE_E_UNINIT                                            0x01\r
44 #define FEE_E_INVALID_BLOCK_NO                          0x02\r
45 #define FEE_E_INVALID_BLOCK_OFS                         0x03\r
46 #define FEE_E_INVALID_DATA_PTR                          0x04\r
47 #define FEE_E_INVALID_BLOCK_LEN                         0x05\r
48 #define FEE_E_BUSY                                                      0x06\r
49 \r
50 \r
51 \r
52 // Other error codes reported by this module\r
53 #define FEE_PARAM_OUT_OF_RANGE                          0x40\r
54 #define FEE_UNEXPECTED_STATE                            0x41\r
55 #define FEE_FLASH_CORRUPT                                       0xfa\r
56 #define FEE_UNEXPECTED_STATUS                           0xfb\r
57 #define FEE_E_WRONG_CONFIG                                      0xfc\r
58 #define FEE_E_UNEXPECTED_EXECUTION                      0xfd\r
59 #define FEE_E_NOT_SUPPORTED                                     0xfe\r
60 #define FEE_E_NOT_IMPLEMENTED_YET                       0xff\r
61 \r
62 // Service ID in this module\r
63 #define FEE_INIT                                                                0x00\r
64 #define FEE_SET_MODE_ID                                                 0x01\r
65 #define FEE_READ_ID                                                             0x02\r
66 #define FEE_WRITE_ID                                                    0x03\r
67 #define FEE_CANCEL_ID                                                   0x04\r
68 #define FEE_GET_STATUS_ID                                               0x05\r
69 #define FEE_GET_JOB_RESULT_ID                                   0x06\r
70 #define FEE_INVALIDATE_BLOCK_ID                                 0x07\r
71 #define FEE_GET_VERSION_INFO_ID                                 0x08\r
72 #define FEE_ERASE_IMMEDIATE_ID                                  0x09\r
73 #define FEE_JOB_END_NOTIFICTION_ID                              0x10\r
74 #define FEE_JOB_ERROR_NOTIFICTION_ID                    0x11\r
75 #define FEE_MAIN_FUNCTION_ID                                    0x12\r
76 \r
77 #define FEE_STARTUP_ID                                                  0x40\r
78 #define FEE_GARBAGE_WRITE_HEADER_ID                             0x41\r
79 #define FEE_GLOBAL_ID                                                   0xff\r
80 \r
81 #endif\r
82 \r
83 \r
84 #if ( FEE_VERSION_INFO_API == STD_ON )\r
85 #define Fee_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi, FEE)  /** @req FEE093 */\r
86 #endif /* FEE_VERSION_INFO_API */\r
87 \r
88 void Fee_MainFunction(void);    /** @req FEE097 */\r
89 \r
90 void Fee_Init(void);    /** @req FEE085 */\r
91 void Fee_SetMode(MemIf_ModeType mode);  /** @req FEE086 */\r
92 Std_ReturnType Fee_Read(uint16 blockNumber, uint16 blockOffset, uint8* dataBufferPtr, uint16 length); /** @req FEE087 */\r
93 Std_ReturnType Fee_Write(uint16 blockNumber, uint8* dataBufferPtr); /** @req FEE088 */\r
94 void Fee_Cancel(void);  /** @req FEE089 */\r
95 MemIf_StatusType Fee_GetStatus(void);   /** @req FEE090 */\r
96 MemIf_JobResultType Fee_GetJobResult(void);     /** @req FEE091 */\r
97 Std_ReturnType Fee_InvalidateBlock(uint16 blockNumber); /** @req FEE092 */\r
98 Std_ReturnType Fee_EraseImmediateBlock(uint16 blockNumber);     /** @req FEE094 */\r
99 \r
100 \r
101 \r
102 #endif /*FEE_H_*/\r