usbmgmt/usbmgr/usbman/server/public/usbotgdefs.h
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Shared OTG definitions
       
    16 *
       
    17 */
       
    18 
       
    19 /**
       
    20  @file
       
    21  @publishedPartner
       
    22  @released
       
    23 */
       
    24 
       
    25 #ifndef __USBOTGDEFS_H__
       
    26 #define __USBOTGDEFS_H__
       
    27 
       
    28 #include <e32std.h>
       
    29 	
       
    30 const TUint32 KUsbmanSvrSid = {0x101fe1db};
       
    31 const TUid KUidUsbManCategory = {0x101fe1db};
       
    32 const TUint KUsbOtgIdPinPresentProperty = 3; 	// Id-Pin present
       
    33 const TUint KUsbOtgVBusPoweredProperty = 4;  	// VBus powered up
       
    34 const TUint KUsbOtgStateProperty = 5;  			// OTG State
       
    35 const TUint KUsbRequestSessionProperty = 6;  	// Request VBus
       
    36 const TUint KUsbOtgConnectionIdleProperty = 7;  // Connection Idle
       
    37 
       
    38 /**
       
    39 	OTG State, supplied in a form that will enable use as an array
       
    40 	index (note also how this is used below in the bit-mask form)
       
    41 */
       
    42 enum TUsbOtgState
       
    43 	{
       
    44 	/**
       
    45 	Single case of non-stable state, used only during
       
    46 	startup
       
    47 	*/
       
    48 	EUsbOtgStateReset = 0x01,
       
    49 
       
    50 	/**
       
    51 	'A'-connection states (names are derived from OTG-Supplement
       
    52 	Figure 6-2 On-The-Go A-Device State Diagram)
       
    53 	*/
       
    54 	EUsbOtgStateAIdle = 0x02,
       
    55 	EUsbOtgStateAHost = 0x04,
       
    56 	EUsbOtgStateAPeripheral = 0x08,
       
    57 	EUsbOtgStateAVbusError = 0x10,
       
    58 
       
    59 	/**
       
    60 	'B'-connection states (names are derived from OTG-Supplement
       
    61 	Figure 6-3 On-The-Go B-Device State Diagram)
       
    62 	*/
       
    63 	EUsbOtgStateBIdle = 0x20,
       
    64 	EUsbOtgStateBPeripheral = 0x40,
       
    65 	EUsbOtgStateBHost = 0x80,
       
    66 	};
       
    67 
       
    68 /**
       
    69 	OTG Events, supplied in a form that can be used to create a mask
       
    70 	that can specify a watcher's events of interest.
       
    71 */
       
    72 enum TUsbOtgEvent
       
    73 	{
       
    74 	/**
       
    75 	OTG events related to plug insertion or removal
       
    76 	*/
       
    77 	EUsbOtgEventAPlugInserted 		= 0x01,
       
    78 	EUsbOtgEventAPlugRemoved  		= 0x02,
       
    79 
       
    80 	/**
       
    81 	OTG events relating to changes visible on the bus
       
    82 	*/
       
    83 	EUsbOtgEventVbusRaised			= 0x04,
       
    84 	EUsbOtgEventVbusDropped			= 0x08,
       
    85 
       
    86 	EUsbOtgEventSrpInitiated		= 0x10,
       
    87 
       
    88 	EUsbOtgEventSrpReceived			= 0x20,
       
    89 	EUsbOtgEventHnpEnabled			= 0x40,
       
    90 	EUsbOtgEventHnpDisabled			= 0x80,
       
    91 
       
    92 	/**
       
    93 	OTG events related to changes in the current role the device
       
    94 	is performing (independant of the orientation of the connection)
       
    95 	*/
       
    96 	EUsbOtgEventRoleChangedToHost	= 0x100,
       
    97 	EUsbOtgEventRoleChangedToDevice	= 0x200,
       
    98 	EUsbOtgEventRoleChangedToIdle	= 0x400
       
    99 	};
       
   100 
       
   101 #endif //__USBOTGDEFS_H__