First public contribution.
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\drivers\crashflash\crashflashnor.h
16 // WARNING: This file contains some APIs which are internal and are subject
17 // to change without notice. Such APIs should therefore not be used
18 // outside the Kernel and Hardware Services package.
21 #ifndef __CRASH_FLASH_NOR_H__
22 #define __CRASH_FLASH_NOR_H__
26 #include <crashflash.h>
27 #include <kernel/kernel.h>
33 /* The generic crash flash nor support allows for a 32, 16, or 8 bit interface
34 * to the nor flash chip. One of the following should be defined in the
37 #ifdef TCFI_4BYTE_WORD
38 typedef TUint32 TCFIWord;
39 #elif defined(TCFI_2BYTE_WORD)
40 typedef TUint16 TCFIWord;
41 #elif defined(TCFI_1BYTE_WORD)
42 typedef TUint8 TCFIWord;
44 #error One of TCFI_4BYTE_WORD, TCFI_2BYTE_WORD, or TCFI_1BYTE_WORD must be defined.
48 An implmentation of the CrashFlash interface for nor flash.
51 class CrashFlashNor : public CrashFlash
55 void StartTransaction();
56 void EndTransaction();
57 void Write(const TDesC8& aDes);
58 void WriteSignature(const TDesC8& aDes);
59 void Read(TDes8& aDes);
60 void SetReadPos(TUint aPos);
61 void SetWritePos(const TUint aPos);
64 void EraseFlashBlock(TUint aBlock);
65 #ifdef _CRASHLOG_COMPR
66 TUint GetOutputLimit();
72 virtual TInt VariantInitialise()=0;
75 virtual void DoWrite(TCFIWord aWord)=0;
78 virtual TCFIWord DoRead()=0;
81 virtual void DoEraseBlock(TUint aBlock)=0;
90 TUint iEraseBlockSize;