sl@0: // Copyright (c) 1998-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\include\drivers\pccd_ifc.h sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef __PCCD_IFC_H__ sl@0: #define __PCCD_IFC_H__ sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #define __PCCD_MACHINE_CODED__ sl@0: sl@0: const TInt KMemConfigByteAccess=1; sl@0: sl@0: class PccdIfc sl@0: { sl@0: public: sl@0: static DPcCardSocket* NewSocket(TInt aSocketNum); sl@0: static DPcCardMediaChange* NewMediaChange(TInt aMcId); sl@0: static DPcCardVcc* NewVcc(TInt aVccNum, TInt aMcId); sl@0: static DPccdChunkBase* NewChunk(TPccdMemType aType); sl@0: }; sl@0: sl@0: /** sl@0: A base class that defines a Pc Card controller interface. sl@0: sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: class TPcCardControllerInterface sl@0: { sl@0: public: sl@0: /** sl@0: Allocate any resources. Only done once on kernel initialization so don't worry about cleanup if it fails. sl@0: sl@0: @return KErrNone if successful in allocating memory for the Pc Card. otherwise return KErrNoMemory. sl@0: */ sl@0: IMPORT_C TInt Create(); sl@0: public: sl@0: /** sl@0: Gets the physical address of Pc Card memory. sl@0: sl@0: @param aCard A Pc Card whose physical address to be returned. sl@0: sl@0: @param aType Memory type of the Pc Card whose physical address to be returned. sl@0: sl@0: @return Physical address of Pc Card for the given memory type. sl@0: sl@0: @see TPccdMemType sl@0: */ sl@0: virtual TUint32 MemPhysicalAddress(TInt aCard,TPccdMemType aType)=0; sl@0: /** sl@0: Sets the Pc Card controller h/w. sl@0: sl@0: Initialise the Pc Card Controller h/w. sl@0: sl@0: @return KErrNone if Pc Card contorller h/w is initialised. sl@0: */ sl@0: virtual TInt Init()=0; sl@0: /** sl@0: Gets the current settings for the Pc Card. sl@0: sl@0: @param aCard A Pc Card whose signals to be indicated. sl@0: sl@0: @param anInd Has current settings for the PC Card indicator signals into 'anInd' for the specified aCard. sl@0: sl@0: @return KErrNone if successful. sl@0: sl@0: @see TSocketIndicators. sl@0: */ sl@0: virtual TInt Indicators(TInt aCard,TSocketIndicators &anInd)=0; sl@0: /** sl@0: Enables the Pc Card Interface. sl@0: sl@0: @param aCard A Pc Card whose interface to be enabled. sl@0: */ sl@0: virtual void InterfaceOn(TInt aCard)=0; sl@0: /** sl@0: Disables the Pc Card Interface. sl@0: sl@0: @param aCard A PC Card whose interface to be disabled. sl@0: */ sl@0: virtual void InterfaceOff(TInt aCard)=0; sl@0: /** sl@0: To Apply/remove h/w reset. sl@0: sl@0: @param aCard A Pc Card which has to be h/w reseted. sl@0: sl@0: @param anAssert To make the h/w reset guarented. sl@0: */ sl@0: virtual void CardReset(TInt aCard,TBool anAssert)=0; sl@0: /** sl@0: Gets Pc Card Rdy/Bsy status. sl@0: sl@0: @param aCard Pc Card whose status to be returned. sl@0: sl@0: @return True if the card is ready. sl@0: */ sl@0: virtual TBool CardReady(TInt aCard)=0; sl@0: /** sl@0: Configure memory configuration options. sl@0: sl@0: @param aCard Pc Card whose memory to be configured. sl@0: sl@0: @param aMemType Type of memory to be configured. sl@0: sl@0: @param aSpeed Access speed of the memory involved. sl@0: sl@0: @param aWaitSig This WaitSig should never checked since repeated accesses to MECR seem to crash the system sl@0: in mysterious ways. sl@0: sl@0: @param aFlag To modify the memory configuration attributes by ORing with memory chunk setup flags pKPccdBusWidth32 and KPccdDisableWaitStateCntrl , sl@0: sl@0: @return KErrNone if successful, KErrNotSupported if unsuccessful. sl@0: sl@0: @see TPccdMemType. sl@0: sl@0: @see TPccdAccessSpeed. sl@0: */ sl@0: virtual TInt MemConfig(TInt aCard,TPccdMemType aMemType,TPccdAccessSpeed aSpeed,TBool aWaitSig,TUint aFlag)=0; sl@0: /** sl@0: Gets the information of the socket. sl@0: sl@0: @param aSocket Socket whose information to be retrieved. sl@0: sl@0: @param anInfo Gets the socket information in anInfo. sl@0: sl@0: @see TPcCardSocketInfo. sl@0: */ sl@0: virtual void SocketInfo(TSocket aSocket,TPcCardSocketInfo& anInfo)=0; sl@0: /** sl@0: Checks the specified socket contains a card (and the media door for the socket is closed). sl@0: sl@0: @param anInfo Has the socket information. sl@0: sl@0: @param aCard Socket for which a card presence is checked. sl@0: sl@0: @return True if the socket contians a card (and the media door for the socket is closed). sl@0: */ sl@0: virtual TBool CardIsPresent(TInt aCard)=0; sl@0: /** sl@0: Gets the changed state of the specified media (ex,removed,inserted..) sl@0: sl@0: @param aMediaChangeId stores the state of the specified media change sl@0: sl@0: @return Mediastate when change to media takes place. sl@0: sl@0: @see TMediaState. sl@0: */ sl@0: virtual TMediaState MediaState(TInt aMediaChangeId)=0; sl@0: // Pc Card PSUs sl@0: /** sl@0: Sets Vcc information for the Pc Card. sl@0: sl@0: @param aPsu Power supply unit value supplied for the Pc Card. sl@0: sl@0: @param aninfo Object of TPBusPsuInfo type passed to store the PSU information. sl@0: sl@0: @see TPBusPsuInfo. sl@0: */ sl@0: virtual void VccInfo(TInt aPsu,TPBusPsuInfo &aninfo)=0; sl@0: /** sl@0: Sets Pc Card Vcc power supply OFF. sl@0: sl@0: @param aPsu Power supply unit for the Pc Card. sl@0: */ sl@0: virtual void VccOff(TInt aPsu)=0; sl@0: /** sl@0: Sets Pc Card Vcc power supply ON. sl@0: sl@0: @param aPsu Power supply unit for the Pc Card. sl@0: sl@0: @param aVoltageSetting A voltage to power on Pc Card which is defined in enum TPccdSocketVcc. sl@0: sl@0: @see TPccdSocketVcc sl@0: */ sl@0: virtual void VccOnFull(TInt aPsu,TPccdSocketVcc aVoltageSetting)=0; sl@0: /** sl@0: Sets Pc Card Vcc power supply ON with current limit. sl@0: sl@0: @param aPsu Power supply unit for the Pc Card. sl@0: sl@0: @param aVoltageSetting A voltage of current limt to power on Pc Card which is defined in enum TPccdSocketVcc. sl@0: sl@0: @see TPccdSocketVcc sl@0: */ sl@0: virtual void VccOnCurrentLimit(TInt aPsu,TPccdSocketVcc aVoltageSetting)=0; sl@0: /** sl@0: Sets Pc Card Vcc level (normally ADC reading). Return KErrNotReady if the voltage check isn't complete. sl@0: sl@0: @param aPsu Power supply unit for the Pc Card. sl@0: */ sl@0: virtual TInt VccInMilliVolts(TInt aPsu)=0; sl@0: /* sl@0: Gets Pc Card Vcc voltage status. sl@0: sl@0: An alternative to using ADC, when voltage checking is performed using a comparator arrangement. sl@0: sl@0: @param aPsu Power supply unit for the Pc Card. sl@0: sl@0: @return KErrNone if successful, KErrGeneral if failed. sl@0: */ sl@0: virtual TInt VccVoltCheck(TInt aPsu)=0; sl@0: // interrupts sl@0: /** sl@0: Gets a interrupt Id for Pc card. sl@0: sl@0: @param aCard Pc Card to which interrupts Id is requested. sl@0: sl@0: @return InterruptId of the Pc Card. sl@0: */ sl@0: virtual TInt IntIdIReq(TInt aCard)=0; sl@0: /** sl@0: Gets ready interrupt Id when ready signal is asserted on Pc Card. sl@0: sl@0: @param aCard Pc Card which is interrupted through a ready signal. sl@0: sl@0: @return Ready interrupt Id for the Pc Card. sl@0: */ sl@0: virtual TInt IntIdRdyC(TInt aCard)=0; sl@0: /** sl@0: Gets interrupt status Id when status of Pc Card changes. sl@0: sl@0: @param aCard Pc Card which is interrupted through a change in state. sl@0: sl@0: @return Interrupt status Id, for the Pc Card. sl@0: */ sl@0: virtual TInt IntIdStsC(TInt aCard)=0; sl@0: /** sl@0: Gets Mediachange interrupt Id when media changes, i,e when media door is Opend/Closed. sl@0: sl@0: @param aMediaChangeId An media chagne Id which tells whether media door is closed / Opened. sl@0: sl@0: @return Media change interrupt id, when a change in media takes place. sl@0: */ sl@0: virtual TInt IntIdMediaChange(TInt aMediaChangeId)=0; sl@0: /** sl@0: Acknowledge the media change interrupt. sl@0: sl@0: @param aMediaChangeId An media change Id which tells whether a door is closed / Opened. sl@0: */ sl@0: virtual void ClearMediaChange(TInt aMediaChangeId)=0; sl@0: // machine configuration sl@0: /** sl@0: @param aSocket the socket ID. sl@0: sl@0: @param aMediaDeviceInfo , Media information of the scoket which has to be checked. sl@0: sl@0: @return True if Pc Card is present in the secified socket. sl@0: */ sl@0: virtual TBool IsPcCardSocket(TInt aSocket,SMediaDeviceInfo& aMediaDeviceInfo)=0; sl@0: /** sl@0: Gets information about from which socket does the media change took place. sl@0: sl@0: @param aSocket the socket ID. sl@0: sl@0: @return socket from which socket does the media change took place. sl@0: */ sl@0: virtual TInt MediaChangeFromSocket(TInt aSocket)=0; sl@0: /** sl@0: Gets from which socket does the Vcc signal is generated. sl@0: sl@0: @param aSocket the socket ID. sl@0: sl@0: @return socket Id from which Vcc signal is generated. sl@0: */ sl@0: virtual TInt VccFromSocket(TInt aSocket)=0; sl@0: }; sl@0: sl@0: GLREF_D TPcCardControllerInterface* ThePccdCntrlInterface; sl@0: sl@0: #endif sl@0: sl@0: