]> rtime.felk.cvut.cz Git - arc.git/blob - include/Fls_SST25xx.h
Regenerated examples. Removed linux board. Added default cross compiler for TI.
[arc.git] / include / Fls_SST25xx.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 \r
24 #ifndef FLS_SST25XX_H_\r
25 #define FLS_SST25XX_H_\r
26 \r
27 \r
28 // Only if external flash device\r
29 //#include "Spi.h"\r
30 #include "Std_Types.h"\r
31 #include "Det.h"\r
32 #include "Fls.h"\r
33 \r
34 // SW ans Autosar spec versions\r
35 #define FLS_SST25XX_SW_MAJOR_VERSION            1\r
36 #define FLS_SST25XX_SW_MINOR_VERSION            0\r
37 #define FLS_SST25XX_SW_PATCH_VERSION            0\r
38 #define FLS_SST25XX_AR_MAJOR_VERSION            3\r
39 #define FLS_SST25XX_AR_MINOR_VERSION            0\r
40 #define FLS_SST25XX_AR_PATCH_VERSION            2\r
41 \r
42 #if 0\r
43 // Used as address offset from the configured flash base address to access a certain\r
44 // flash memory area.\r
45 typedef uint32 Fls_AddressType;\r
46 \r
47 // Specifies the number of bytes to read/write/erase/compare\r
48 //\r
49 // Note!\r
50 // Shall be the same type as Fls_AddressType because of\r
51 // arithmetic operations. Size depends on target platform and\r
52 // flash device.\r
53 typedef uint32 Fls_LengthType;\r
54 #endif\r
55 \r
56 #include "Fls_SST25xx_Cfg.h"\r
57 \r
58 /**\r
59  * Initializes the Flash Driver.\r
60  *\r
61  * @param ConfigPtr Pointer to flash driver configuration set.\r
62  */\r
63 void Fls_SST25xx_Init( const Fls_ConfigType *ConfigPtr );\r
64 \r
65 \r
66 /**\r
67  * Erases flash sector(s).\r
68  *\r
69  * @param TargetAddress Target address in flash memory.\r
70  *                      This address offset will be\r
71  *                                              added to the flash memory base address.\r
72  *                                              Min.: 0\r
73  *                      Max.: FLS_SIZE - 1\r
74  *\r
75  * @param Length                Number of bytes to erase\r
76  *                      Min.: 1\r
77  *                      Max.: FLS_SIZE - TargetAddress\r
78  *\r
79  * @return E_OK: erase command has been accepted\r
80  *         E_NOT_OK: erase command has not been accepted\r
81  */\r
82 #if 0\r
83 typedef uint32 Fls_AddressType;\r
84 \r
85 // Specifies the number of bytes to read/write/erase/compare\r
86 //\r
87 // Note!\r
88 // Shall be the same type as Fls_AddressType because of\r
89 // arithmetic operations. Size depends on target platform and\r
90 // flash device.\r
91 typedef uint32 Fls_LengthType;\r
92 #endif\r
93 \r
94 \r
95 Std_ReturnType Fls_SST25xx_Erase(       Fls_AddressType   TargetAddress,\r
96                         Fls_LengthType    Length );\r
97 \r
98 \r
99 Std_ReturnType Fls_SST25xx_Write (    Fls_AddressType   TargetAddress,\r
100                         const uint8         *SourceAddressPtr,\r
101                         Fls_LengthType    Length );\r
102 \r
103 #if ( FLS_CANCEL_API == STD_ON )\r
104 void                            Fls_SST25xx_Cancel( void );\r
105 #endif\r
106 \r
107 MemIf_StatusType        Fls_SST25xx_GetStatus(  void );\r
108 MemIf_JobResultType Fls_SST25xx_GetJobResult( void );\r
109 \r
110 void Fls_SST25xx_MainFunction( void );\r
111 \r
112 Std_ReturnType Fls_SST25xx_Read (       Fls_AddressType SourceAddress,\r
113               uint8 *TargetAddressPtr,\r
114               Fls_LengthType Length );\r
115 \r
116 #if ( FLS_COMPARE_API == STD_ON )\r
117 Std_ReturnType Fls_SST25xx_Compare( Fls_AddressType SourceAddress,\r
118               uint8 *TargetAddressPtr,\r
119               Fls_LengthType Length );\r
120 #endif\r
121 \r
122 #if ( FLS_SET_MODE_API == STD_ON )\r
123 void Fls_SST25xx_SetMode(               Fls_ModeType Mode );\r
124 #endif\r
125 \r
126 void Fls_SST25xx_GetVersionInfo( Std_VersionInfoType *VersioninfoPtr );\r
127 \r
128 \r
129 #endif /* FLS_SST25XX_H_ */\r