1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/include/drivers/comm.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,137 @@
1.4 +// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32\include\drivers\comm.inl
1.18 +//
1.19 +// WARNING: This file contains some APIs which are internal and are subject
1.20 +// to change without noticed. Such APIs should therefore not be used
1.21 +// outside the Kernel and Hardware Services package.
1.22 +//
1.23 +
1.24 +/**
1.25 + @file
1.26 + @internalComponent
1.27 +
1.28 + This function informs the power model about the electrical current requirements.
1.29 + @param aCurrent The required electrical current.
1.30 + @publishedPartner
1.31 + @deprecated
1.32 +*/
1.33 +inline void DComm::SetCurrent(TInt aCurrent)
1.34 + { iLdd->iPowerHandler->SetCurrentConsumption(aCurrent); }
1.35 +
1.36 +/**
1.37 +Handles the received character block from the ISR.
1.38 +@param aChar points to received characters.
1.39 +@param aCount number of characters received.
1.40 +@param aXonXoff =1 if XON received, -1 if XOFF received, 0 if neither.
1.41 +@publishedPartner
1.42 +@released
1.43 +*/
1.44 +inline void DComm::ReceiveIsr(TUint* aChar, TInt aCount, TInt aXonXoff)
1.45 + { iLdd->ReceiveIsr(aChar,aCount,aXonXoff); }
1.46 +
1.47 +/**
1.48 +Fetches the next character to be transmitted in an ISR.
1.49 +@return The character to be transmitted.
1.50 +@publishedPartner
1.51 +@released
1.52 +*/
1.53 +inline TInt DComm::TransmitIsr()
1.54 + { return iLdd->TransmitIsr(); }
1.55 +
1.56 +/**
1.57 +Checks the progress of transmission against the transmit buffer in the LDD.
1.58 +@publishedPartner
1.59 +@released
1.60 +*/
1.61 +inline void DComm::CheckTxBuffer()
1.62 + { iLdd->CheckTxBuffer(); }
1.63 +
1.64 +/**
1.65 +Handles a state change in an ISR.
1.66 +@param aSignals State change communicated by the ISR.
1.67 + For Example: CTS, DSR, DCD, RNG
1.68 +@publishedPartner
1.69 +@released
1.70 +*/
1.71 +inline void DComm::StateIsr(TUint aSignals)
1.72 + { iLdd->StateIsr(aSignals); }
1.73 +
1.74 +/**
1.75 +Checks the status of transmission.
1.76 +@return ETrue if it transmitting chars, EFalse otherwise.
1.77 +@publishedPartner
1.78 +@released
1.79 +*/
1.80 +inline TBool DComm::Transmitting()
1.81 + { return iTransmitting; }
1.82 +
1.83 +
1.84 +inline TBool DChannelComm::AreAnyPending() const
1.85 +// Return TRUE if any requests are pending.
1.86 + {
1.87 + return (iRxBufReq.iBuf || iTxBufReq.iBuf);
1.88 + }
1.89 +
1.90 +inline TBool DChannelComm::IsTerminator(TUint8 aChar)
1.91 + { return (iTerminatorMask[aChar>>3]&(1<<(aChar&7))); }
1.92 +
1.93 +inline void DChannelComm::SetTerminator(TUint8 aChar)
1.94 + { iTerminatorMask[aChar>>3] |= (1<<(aChar&7)); }
1.95 +
1.96 +inline TInt DChannelComm::RxCount()
1.97 + { TInt r=iRxPutIndex-iRxGetIndex; return(r>=0 ? r : r+iRxBufSize); }
1.98 +
1.99 +inline TInt DChannelComm::TxCount()
1.100 + { TInt r=iTxPutIndex-iTxGetIndex; return(r>=0 ? r : r+iTxBufSize); }
1.101 +
1.102 +inline void DChannelComm::EnableTransmit()
1.103 + { ((DComm*)iPdd)->EnableTransmit(); }
1.104 +
1.105 +inline TInt DChannelComm::IsLineFail(TUint aFailSignals)
1.106 + { return(~iSignals & aFailSignals); }
1.107 +
1.108 +inline void DChannelComm::SetStatus(TState aStatus)
1.109 + { iStatus=aStatus; }
1.110 +
1.111 +inline TInt DChannelComm::PddStart()
1.112 + { return ((DComm*)iPdd)->Start(); }
1.113 +
1.114 +inline void DChannelComm::Stop(TStopMode aMode)
1.115 + { ((DComm*)iPdd)->Stop(aMode); }
1.116 +
1.117 +inline void DChannelComm::PddBreak(TBool aState)
1.118 + { ((DComm*)iPdd)->Break(aState); }
1.119 +
1.120 +inline TUint DChannelComm::Signals() const
1.121 + { return ((DComm*)iPdd)->Signals(); }
1.122 +
1.123 +inline void DChannelComm::SetSignals(TUint aSetMask,TUint aClearMask)
1.124 + { ((DComm*)iPdd)->SetSignals(aSetMask,aClearMask); }
1.125 +
1.126 +inline TInt DChannelComm::ValidateConfig(const TCommConfigV01 &aConfig) const
1.127 + { return ((DComm*)iPdd)->ValidateConfig(aConfig); }
1.128 +
1.129 +inline void DChannelComm::PddConfigure(TCommConfigV01 &aConfig)
1.130 + { ((DComm*)iPdd)->Configure(aConfig); }
1.131 +
1.132 +inline void DChannelComm::PddCaps(TDes8 &aCaps) const
1.133 + { ((DComm*)iPdd)->Caps(aCaps); }
1.134 +
1.135 +inline void DChannelComm::PddCheckConfig(TCommConfigV01& aConfig)
1.136 + { ((DComm*)iPdd)->CheckConfig(aConfig); }
1.137 +
1.138 +inline TBool DChannelComm::Transmitting()
1.139 + { return ((DComm*)iPdd)->iTransmitting; }
1.140 +