sl@0: // Copyright (c) 1996-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\comm.inl sl@0: // sl@0: // WARNING: This file contains some APIs which are internal and are subject sl@0: // to change without noticed. Such APIs should therefore not be used sl@0: // outside the Kernel and Hardware Services package. sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: sl@0: This function informs the power model about the electrical current requirements. sl@0: @param aCurrent The required electrical current. sl@0: @publishedPartner sl@0: @deprecated sl@0: */ sl@0: inline void DComm::SetCurrent(TInt aCurrent) sl@0: { iLdd->iPowerHandler->SetCurrentConsumption(aCurrent); } sl@0: sl@0: /** sl@0: Handles the received character block from the ISR. sl@0: @param aChar points to received characters. sl@0: @param aCount number of characters received. sl@0: @param aXonXoff =1 if XON received, -1 if XOFF received, 0 if neither. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: inline void DComm::ReceiveIsr(TUint* aChar, TInt aCount, TInt aXonXoff) sl@0: { iLdd->ReceiveIsr(aChar,aCount,aXonXoff); } sl@0: sl@0: /** sl@0: Fetches the next character to be transmitted in an ISR. sl@0: @return The character to be transmitted. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: inline TInt DComm::TransmitIsr() sl@0: { return iLdd->TransmitIsr(); } sl@0: sl@0: /** sl@0: Checks the progress of transmission against the transmit buffer in the LDD. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: inline void DComm::CheckTxBuffer() sl@0: { iLdd->CheckTxBuffer(); } sl@0: sl@0: /** sl@0: Handles a state change in an ISR. sl@0: @param aSignals State change communicated by the ISR. sl@0: For Example: CTS, DSR, DCD, RNG sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: inline void DComm::StateIsr(TUint aSignals) sl@0: { iLdd->StateIsr(aSignals); } sl@0: sl@0: /** sl@0: Checks the status of transmission. sl@0: @return ETrue if it transmitting chars, EFalse otherwise. sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: inline TBool DComm::Transmitting() sl@0: { return iTransmitting; } sl@0: sl@0: sl@0: inline TBool DChannelComm::AreAnyPending() const sl@0: // Return TRUE if any requests are pending. sl@0: { sl@0: return (iRxBufReq.iBuf || iTxBufReq.iBuf); sl@0: } sl@0: sl@0: inline TBool DChannelComm::IsTerminator(TUint8 aChar) sl@0: { return (iTerminatorMask[aChar>>3]&(1<<(aChar&7))); } sl@0: sl@0: inline void DChannelComm::SetTerminator(TUint8 aChar) sl@0: { iTerminatorMask[aChar>>3] |= (1<<(aChar&7)); } sl@0: sl@0: inline TInt DChannelComm::RxCount() sl@0: { TInt r=iRxPutIndex-iRxGetIndex; return(r>=0 ? r : r+iRxBufSize); } sl@0: sl@0: inline TInt DChannelComm::TxCount() sl@0: { TInt r=iTxPutIndex-iTxGetIndex; return(r>=0 ? r : r+iTxBufSize); } sl@0: sl@0: inline void DChannelComm::EnableTransmit() sl@0: { ((DComm*)iPdd)->EnableTransmit(); } sl@0: sl@0: inline TInt DChannelComm::IsLineFail(TUint aFailSignals) sl@0: { return(~iSignals & aFailSignals); } sl@0: sl@0: inline void DChannelComm::SetStatus(TState aStatus) sl@0: { iStatus=aStatus; } sl@0: sl@0: inline TInt DChannelComm::PddStart() sl@0: { return ((DComm*)iPdd)->Start(); } sl@0: sl@0: inline void DChannelComm::Stop(TStopMode aMode) sl@0: { ((DComm*)iPdd)->Stop(aMode); } sl@0: sl@0: inline void DChannelComm::PddBreak(TBool aState) sl@0: { ((DComm*)iPdd)->Break(aState); } sl@0: sl@0: inline TUint DChannelComm::Signals() const sl@0: { return ((DComm*)iPdd)->Signals(); } sl@0: sl@0: inline void DChannelComm::SetSignals(TUint aSetMask,TUint aClearMask) sl@0: { ((DComm*)iPdd)->SetSignals(aSetMask,aClearMask); } sl@0: sl@0: inline TInt DChannelComm::ValidateConfig(const TCommConfigV01 &aConfig) const sl@0: { return ((DComm*)iPdd)->ValidateConfig(aConfig); } sl@0: sl@0: inline void DChannelComm::PddConfigure(TCommConfigV01 &aConfig) sl@0: { ((DComm*)iPdd)->Configure(aConfig); } sl@0: sl@0: inline void DChannelComm::PddCaps(TDes8 &aCaps) const sl@0: { ((DComm*)iPdd)->Caps(aCaps); } sl@0: sl@0: inline void DChannelComm::PddCheckConfig(TCommConfigV01& aConfig) sl@0: { ((DComm*)iPdd)->CheckConfig(aConfig); } sl@0: sl@0: inline TBool DChannelComm::Transmitting() sl@0: { return ((DComm*)iPdd)->iTransmitting; } sl@0: