sl@0: // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32\drivers\crashflash\crashflashnor.h sl@0: // sl@0: // WARNING: This file contains some APIs which are internal and are subject sl@0: // to change without notice. Such APIs should therefore not be used sl@0: // outside the Kernel and Hardware Services package. sl@0: // sl@0: sl@0: #ifndef __CRASH_FLASH_NOR_H__ sl@0: #define __CRASH_FLASH_NOR_H__ sl@0: sl@0: #ifndef EPOC32 sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /* @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: /* The generic crash flash nor support allows for a 32, 16, or 8 bit interface sl@0: * to the nor flash chip. One of the following should be defined in the sl@0: * variant's mmp file. sl@0: */ sl@0: #ifdef TCFI_4BYTE_WORD sl@0: typedef TUint32 TCFIWord; sl@0: #elif defined(TCFI_2BYTE_WORD) sl@0: typedef TUint16 TCFIWord; sl@0: #elif defined(TCFI_1BYTE_WORD) sl@0: typedef TUint8 TCFIWord; sl@0: #else sl@0: #error One of TCFI_4BYTE_WORD, TCFI_2BYTE_WORD, or TCFI_1BYTE_WORD must be defined. sl@0: #endif sl@0: sl@0: /** sl@0: An implmentation of the CrashFlash interface for nor flash. sl@0: @internalTechnology sl@0: */ sl@0: class CrashFlashNor : public CrashFlash sl@0: { sl@0: public: sl@0: TInt Initialise(); sl@0: void StartTransaction(); sl@0: void EndTransaction(); sl@0: void Write(const TDesC8& aDes); sl@0: void WriteSignature(const TDesC8& aDes); sl@0: void Read(TDes8& aDes); sl@0: void SetReadPos(TUint aPos); sl@0: void SetWritePos(const TUint aPos); sl@0: void EraseLogArea(); sl@0: TUint BytesWritten(); sl@0: void EraseFlashBlock(TUint aBlock); sl@0: #ifdef _CRASHLOG_COMPR sl@0: TUint GetOutputLimit(); sl@0: TUint GetLogOffset(); sl@0: #endif sl@0: protected: sl@0: /** @publishedPartner sl@0: @released */ sl@0: virtual TInt VariantInitialise()=0; sl@0: /** @publishedPartner sl@0: @released */ sl@0: virtual void DoWrite(TCFIWord aWord)=0; sl@0: /** @publishedPartner sl@0: @released */ sl@0: virtual TCFIWord DoRead()=0; sl@0: /** @publishedPartner sl@0: @released */ sl@0: virtual void DoEraseBlock(TUint aBlock)=0; sl@0: private: sl@0: TCFIWord iWriteBuf; sl@0: TCFIWord iReadBuf; sl@0: TUint iWriteBufBytes; sl@0: TUint iReadBufBytes; sl@0: protected: sl@0: /** @publishedPartner sl@0: @released */ sl@0: TUint iEraseBlockSize; sl@0: /** @publishedPartner sl@0: @released */ sl@0: TUint iWritePos; sl@0: /** @publishedPartner sl@0: @released */ sl@0: TUint iReadPos; sl@0: private: sl@0: TUint iWriteTotal; sl@0: }; sl@0: sl@0: #endif sl@0: sl@0: #endif