0
|
1 |
// Copyright (c) 1996-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".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// e32\include\drivers\comm.inl
|
|
15 |
//
|
|
16 |
// WARNING: This file contains some APIs which are internal and are subject
|
|
17 |
// to change without noticed. Such APIs should therefore not be used
|
|
18 |
// outside the Kernel and Hardware Services package.
|
|
19 |
//
|
|
20 |
|
|
21 |
/**
|
|
22 |
@file
|
|
23 |
@internalComponent
|
|
24 |
|
|
25 |
This function informs the power model about the electrical current requirements.
|
|
26 |
@param aCurrent The required electrical current.
|
|
27 |
@publishedPartner
|
|
28 |
@deprecated
|
|
29 |
*/
|
|
30 |
inline void DComm::SetCurrent(TInt aCurrent)
|
|
31 |
{ iLdd->iPowerHandler->SetCurrentConsumption(aCurrent); }
|
|
32 |
|
|
33 |
/**
|
|
34 |
Handles the received character block from the ISR.
|
|
35 |
@param aChar points to received characters.
|
|
36 |
@param aCount number of characters received.
|
|
37 |
@param aXonXoff =1 if XON received, -1 if XOFF received, 0 if neither.
|
|
38 |
@publishedPartner
|
|
39 |
@released
|
|
40 |
*/
|
|
41 |
inline void DComm::ReceiveIsr(TUint* aChar, TInt aCount, TInt aXonXoff)
|
|
42 |
{ iLdd->ReceiveIsr(aChar,aCount,aXonXoff); }
|
|
43 |
|
|
44 |
/**
|
|
45 |
Fetches the next character to be transmitted in an ISR.
|
|
46 |
@return The character to be transmitted.
|
|
47 |
@publishedPartner
|
|
48 |
@released
|
|
49 |
*/
|
|
50 |
inline TInt DComm::TransmitIsr()
|
|
51 |
{ return iLdd->TransmitIsr(); }
|
|
52 |
|
|
53 |
/**
|
|
54 |
Checks the progress of transmission against the transmit buffer in the LDD.
|
|
55 |
@publishedPartner
|
|
56 |
@released
|
|
57 |
*/
|
|
58 |
inline void DComm::CheckTxBuffer()
|
|
59 |
{ iLdd->CheckTxBuffer(); }
|
|
60 |
|
|
61 |
/**
|
|
62 |
Handles a state change in an ISR.
|
|
63 |
@param aSignals State change communicated by the ISR.
|
|
64 |
For Example: CTS, DSR, DCD, RNG
|
|
65 |
@publishedPartner
|
|
66 |
@released
|
|
67 |
*/
|
|
68 |
inline void DComm::StateIsr(TUint aSignals)
|
|
69 |
{ iLdd->StateIsr(aSignals); }
|
|
70 |
|
|
71 |
/**
|
|
72 |
Checks the status of transmission.
|
|
73 |
@return ETrue if it transmitting chars, EFalse otherwise.
|
|
74 |
@publishedPartner
|
|
75 |
@released
|
|
76 |
*/
|
|
77 |
inline TBool DComm::Transmitting()
|
|
78 |
{ return iTransmitting; }
|
|
79 |
|
|
80 |
|
|
81 |
inline TBool DChannelComm::AreAnyPending() const
|
|
82 |
// Return TRUE if any requests are pending.
|
|
83 |
{
|
|
84 |
return (iRxBufReq.iBuf || iTxBufReq.iBuf);
|
|
85 |
}
|
|
86 |
|
|
87 |
inline TBool DChannelComm::IsTerminator(TUint8 aChar)
|
|
88 |
{ return (iTerminatorMask[aChar>>3]&(1<<(aChar&7))); }
|
|
89 |
|
|
90 |
inline void DChannelComm::SetTerminator(TUint8 aChar)
|
|
91 |
{ iTerminatorMask[aChar>>3] |= (1<<(aChar&7)); }
|
|
92 |
|
|
93 |
inline TInt DChannelComm::RxCount()
|
|
94 |
{ TInt r=iRxPutIndex-iRxGetIndex; return(r>=0 ? r : r+iRxBufSize); }
|
|
95 |
|
|
96 |
inline TInt DChannelComm::TxCount()
|
|
97 |
{ TInt r=iTxPutIndex-iTxGetIndex; return(r>=0 ? r : r+iTxBufSize); }
|
|
98 |
|
|
99 |
inline void DChannelComm::EnableTransmit()
|
|
100 |
{ ((DComm*)iPdd)->EnableTransmit(); }
|
|
101 |
|
|
102 |
inline TInt DChannelComm::IsLineFail(TUint aFailSignals)
|
|
103 |
{ return(~iSignals & aFailSignals); }
|
|
104 |
|
|
105 |
inline void DChannelComm::SetStatus(TState aStatus)
|
|
106 |
{ iStatus=aStatus; }
|
|
107 |
|
|
108 |
inline TInt DChannelComm::PddStart()
|
|
109 |
{ return ((DComm*)iPdd)->Start(); }
|
|
110 |
|
|
111 |
inline void DChannelComm::Stop(TStopMode aMode)
|
|
112 |
{ ((DComm*)iPdd)->Stop(aMode); }
|
|
113 |
|
|
114 |
inline void DChannelComm::PddBreak(TBool aState)
|
|
115 |
{ ((DComm*)iPdd)->Break(aState); }
|
|
116 |
|
|
117 |
inline TUint DChannelComm::Signals() const
|
|
118 |
{ return ((DComm*)iPdd)->Signals(); }
|
|
119 |
|
|
120 |
inline void DChannelComm::SetSignals(TUint aSetMask,TUint aClearMask)
|
|
121 |
{ ((DComm*)iPdd)->SetSignals(aSetMask,aClearMask); }
|
|
122 |
|
|
123 |
inline TInt DChannelComm::ValidateConfig(const TCommConfigV01 &aConfig) const
|
|
124 |
{ return ((DComm*)iPdd)->ValidateConfig(aConfig); }
|
|
125 |
|
|
126 |
inline void DChannelComm::PddConfigure(TCommConfigV01 &aConfig)
|
|
127 |
{ ((DComm*)iPdd)->Configure(aConfig); }
|
|
128 |
|
|
129 |
inline void DChannelComm::PddCaps(TDes8 &aCaps) const
|
|
130 |
{ ((DComm*)iPdd)->Caps(aCaps); }
|
|
131 |
|
|
132 |
inline void DChannelComm::PddCheckConfig(TCommConfigV01& aConfig)
|
|
133 |
{ ((DComm*)iPdd)->CheckConfig(aConfig); }
|
|
134 |
|
|
135 |
inline TBool DChannelComm::Transmitting()
|
|
136 |
{ return ((DComm*)iPdd)->iTransmitting; }
|
|
137 |
|