1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\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
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
14 * -------------------------------- Arctic Core ------------------------------*/
\r
24 #ifndef FLS_SST25XX_H_
\r
25 #define FLS_SST25XX_H_
\r
28 // Only if external flash device
\r
30 #include "Std_Types.h"
\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
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
47 // Specifies the number of bytes to read/write/erase/compare
\r
50 // Shall be the same type as Fls_AddressType because of
\r
51 // arithmetic operations. Size depends on target platform and
\r
53 typedef uint32 Fls_LengthType;
\r
56 #include "Fls_SST25xx_Cfg.h"
\r
59 * Initializes the Flash Driver.
\r
61 * @param ConfigPtr Pointer to flash driver configuration set.
\r
63 void Fls_SST25xx_Init( const Fls_ConfigType *ConfigPtr );
\r
67 * Erases flash sector(s).
\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
73 * Max.: FLS_SIZE - 1
\r
75 * @param Length Number of bytes to erase
\r
77 * Max.: FLS_SIZE - TargetAddress
\r
79 * @return E_OK: erase command has been accepted
\r
80 * E_NOT_OK: erase command has not been accepted
\r
83 typedef uint32 Fls_AddressType;
\r
85 // Specifies the number of bytes to read/write/erase/compare
\r
88 // Shall be the same type as Fls_AddressType because of
\r
89 // arithmetic operations. Size depends on target platform and
\r
91 typedef uint32 Fls_LengthType;
\r
95 Std_ReturnType Fls_SST25xx_Erase( Fls_AddressType TargetAddress,
\r
96 Fls_LengthType Length );
\r
99 Std_ReturnType Fls_SST25xx_Write ( Fls_AddressType TargetAddress,
\r
100 const uint8 *SourceAddressPtr,
\r
101 Fls_LengthType Length );
\r
103 #if ( FLS_CANCEL_API == STD_ON )
\r
104 void Fls_SST25xx_Cancel( void );
\r
107 MemIf_StatusType Fls_SST25xx_GetStatus( void );
\r
108 MemIf_JobResultType Fls_SST25xx_GetJobResult( void );
\r
110 void Fls_SST25xx_MainFunction( void );
\r
112 Std_ReturnType Fls_SST25xx_Read ( Fls_AddressType SourceAddress,
\r
113 uint8 *TargetAddressPtr,
\r
114 Fls_LengthType Length );
\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
122 #if ( FLS_SET_MODE_API == STD_ON )
\r
123 void Fls_SST25xx_SetMode( Fls_ModeType Mode );
\r
126 void Fls_SST25xx_GetVersionInfo( Std_VersionInfoType *VersioninfoPtr );
\r
129 #endif /* FLS_SST25XX_H_ */
\r