usbdrv/peripheral/public/usbcsc.inl
changeset 33 089413cdde3c
child 59 bbdce6bffaad
equal deleted inserted replaced
29:59aa7d6e3e0f 33:089413cdde3c
       
     1 // Copyright (c) 2008-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\usbcsc.inl
       
    15 // Kernel side inline header file for USB device driver.
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file usbcsc.inl
       
    21  @internalTechnology
       
    22 */
       
    23 
       
    24 #ifndef __USBCSC_INL__
       
    25 #define __USBCSC_INL__
       
    26  
       
    27 
       
    28 //
       
    29 // --- USB Logical Device Driver (LDD) ---
       
    30 //
       
    31 
       
    32 TUsbcScEndpointInfo* TUsbcScEndpoint::EndpointInfo()
       
    33 	{
       
    34 	return &iEndpointInfo;
       
    35 	}
       
    36 
       
    37 
       
    38 void TUsbcScEndpoint::SetClientReadPending(TBool aVal)
       
    39 	{
       
    40 	iClientReadPending = aVal;
       
    41 	}
       
    42 
       
    43 
       
    44 TBool TUsbcScEndpoint::ClientReadPending()
       
    45 	{
       
    46 	return iClientReadPending;
       
    47 	}
       
    48 
       
    49 
       
    50 void TUsbcScEndpoint::SetClientWritePending(TBool aVal)
       
    51 	{
       
    52 	iClientWritePending = aVal;
       
    53 	}
       
    54 
       
    55 
       
    56 TBool TUsbcScEndpoint::ClientWritePending()
       
    57 	{
       
    58 	return iClientWritePending;
       
    59 	}
       
    60 
       
    61 
       
    62 void TUsbcScEndpoint::SetRealEpNumber(TInt aRealEpNumber)
       
    63 	{
       
    64 	iRealEpNumber = aRealEpNumber;
       
    65 	iRequestCallbackInfo->iRealEpNum = aRealEpNumber;
       
    66 	}
       
    67 
       
    68 
       
    69 TInt TUsbcScEndpoint::RealEpNumber() const
       
    70 	{
       
    71 	return iRealEpNumber;
       
    72 	}
       
    73 TInt TUsbcScEndpoint::EpNumber() const
       
    74 	{
       
    75 	return iEndpointNumber;
       
    76 	}
       
    77 void TUsbcScEndpoint::StartBuffer()
       
    78 	{
       
    79 	iBuffer->StartEndpoint(iRequestCallbackInfo, iEndpointInfo.iFlags);
       
    80 	}
       
    81 
       
    82 void TUsbcScEndpoint::SetBuffer(TUsbcScBuffer* aBuffer)
       
    83 	{
       
    84 		__ASSERT_ALWAYS(iBuffer==NULL, Kern::Fault("TUsbcScEndpoint::SetBuffer", __LINE__));
       
    85 		iBuffer = aBuffer;
       
    86 	}
       
    87 
       
    88 TUsbcScBuffer* TUsbcScEndpoint::GetBuffer()
       
    89 	{
       
    90 		__ASSERT_DEBUG(iBuffer!=NULL, Kern::Fault("TUsbcScEndpoint::GetBuffer", __LINE__));
       
    91 	return iBuffer;
       
    92 	}
       
    93 
       
    94 inline TBool DLddUsbcScChannel::ValidEndpoint(TInt aEndpoint)
       
    95 	{
       
    96 	return (aEndpoint <= iNumberOfEndpoints && aEndpoint >= 0);
       
    97 	}
       
    98 
       
    99 inline TBool DLddUsbcScChannel::Configured()
       
   100 	{
       
   101 	if (iValidInterface && 
       
   102 		(iDeviceState == UsbShai::EUsbPeripheralStateConfigured || iDeviceState == UsbShai::EUsbPeripheralStateSuspended))
       
   103 		return ETrue;
       
   104 	return EFalse;
       
   105 	}
       
   106 
       
   107 #endif // __USBCSC_INL__