1 /* |
|
2 * Copyright (c) 2010 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 * |
|
16 */ |
|
17 |
|
18 /** @file |
|
19 @brief USB charging information header |
|
20 @version 0.2.0 |
|
21 |
|
22 This header specifies the published information of USB charging plug-in. |
|
23 @publishedPartner |
|
24 */ |
|
25 |
|
26 #ifndef USBCHARGINGPUBLISHEDINFO_H |
|
27 #define USBCHARGINGPUBLISHEDINFO_H |
|
28 |
|
29 #include <e32base.h> |
|
30 |
|
31 |
|
32 /** this is only applicable when charging port is a Standard Downstream Port |
|
33 */ |
|
34 enum TUsbConnectionStatus |
|
35 { |
|
36 /** this is the initial value. */ |
|
37 EUsbConnectionStatusNone, |
|
38 |
|
39 /** This status means that this USB device is in suspend state. */ |
|
40 EUsbConnectionStatusSuspend, |
|
41 |
|
42 /** This status means that this USB device is in configured state. */ |
|
43 EUsbConnectionStatusConfigured |
|
44 }; |
|
45 |
|
46 enum TUsbChargingPortType |
|
47 { |
|
48 /** |
|
49 * This device is no longer connected to a powered port. |
|
50 * iMinAvailableVbusCurrent, iMaxVbusCurrent and iMinVbusVoltage are 0. |
|
51 * iUsbConnStatus is EUsbConnectionStatusNone. |
|
52 */ |
|
53 EUsbChargingPortTypeNone = 0, |
|
54 |
|
55 /** |
|
56 * This device is connected to a port that can't be recognized. |
|
57 * iMinAvailableVbusCurrent, iMaxVbusCurrent and iMinVbusVoltage are 0. |
|
58 * iUsbConnStatus is EUsbConnectionStatusNone. |
|
59 */ |
|
60 EUsbChargingPortTypeUnsupported, |
|
61 |
|
62 /** |
|
63 * This device is connected to a charging port. |
|
64 * This is not an exact port type and the port may be a dedicated charging port or a charging downstream port. |
|
65 * For there is more constraint on charging downstream port output, current and voltage are computed according |
|
66 * to charging downstream port. |
|
67 * See below for detail. |
|
68 */ |
|
69 EUsbChargingPortTypeChargingPort, |
|
70 |
|
71 /** |
|
72 * This device is connected to a dedicated charging port. |
|
73 * iMinAvailableVbusCurrent is 500mA (refer to min IDCHG in table 5-2 of BC1.1). |
|
74 * iMaxVbusCurrent is 1800mA (refer to IDEV_DCHG in table 5-2 of BC1.1). |
|
75 * iMinVbusVoltage is 2000mV ( refer to VCHG_SHT_DWN in table 5-1 of BC1.1). |
|
76 * iUsbConnStatus is EUsbConnectionStatusNone. |
|
77 */ |
|
78 EUsbChargingPortTypeDedicatedChargingPort, |
|
79 |
|
80 /** |
|
81 * This device is connected to a charging downstream port. |
|
82 * - If this device works at low speed or full speed mode. |
|
83 * - iMinAvailableVbusCurrent is 500mA (refer to min IDCHG in table 5-2 of BC1.1). |
|
84 * - iMaxVbusCurrent is 1500mA (refer to IDEV_HCHG_LFS in table 5-2 of BC1.1). |
|
85 * - iMinVbusVoltage is 2000mV (refer to VCHG_SHT_DWN in table 5-1 of BC1.1). |
|
86 * - iUsbConnStatus is EUsbConnectionStatusNone. |
|
87 * |
|
88 * - If this device works at high speed. |
|
89 * - if USB hardware supports current limit when chirping. |
|
90 * - iMinAvailableVbusCurrent is 500mA (refer to min IDCHG in table 5-2 of BC1.1). |
|
91 * - iMaxVbusCurrent is 900mA (refer to IDEV_HCHG_HS in table 5-2 of BC1.1). |
|
92 * - iMinVbusVoltage is 2000mV (refer to VCHG_SHT_DWN in table 5-1 of BC1.1). |
|
93 * - iUsbConnStatus is EUsbConnectionStatusNone |
|
94 * - if USB hardware does not support current limit when chirping |
|
95 * - iMinAvailableVbusCurrent is 500mA (refer to min IDCHG in table 5-2 of BC1.1). |
|
96 * - iMaxVbusCurrent is 560mA (refer to IDEV_HCHG_CHRP in table 5-2 of BC1.1). |
|
97 * - iMinVbusVoltage is 2000mV (refer to VCHG_SHT_DWN in table 5-1 of BC1.1). |
|
98 * - iUsbConnStatus is EUsbConnectionStatusNone. |
|
99 */ |
|
100 EUsbChargingPortTypeChargingDownstreamPort, |
|
101 |
|
102 /** This device is connected to a standard downstream port. |
|
103 * This device negoiates the charging current with standard host by configuration descriptor. There are three numbers of |
|
104 * milliamps that can be negoiated, 500mA, 100mA and 8mA. |
|
105 * - if any of the three numbers is acceptted by host. |
|
106 * - if this device is in configured state. |
|
107 * - iMinAvailableVbusCurrent and iMaxVbusCurrent are 500mA or 100mA or 8mA. |
|
108 * - iUsbConnStatus is EUsbConnectionStatusConfigured. |
|
109 * - if this device is in suspend state. |
|
110 * - iMinAvailableVbusCurrent and iMaxVbusCurrent are 2mA (refer to ISUSP in table 5-2 of BC1.1). |
|
111 * - iUsbConnStatus is EUsbConnectionStatusSuspend. |
|
112 * - iMinVbusVoltage is 4500mV in both cases. 4.5 V comes from the port supply requirement 4.75 V with the worst case |
|
113 * voltage drops for 500 mA current taken into account. That is: 4.75 V - VGNDD - VBUSD = 4.75 V - 0.125 V - 0.125 V = 4.5 V. |
|
114 * See Section 7.2.2 Voltage Drop Budget in USB 2.0 spec. |
|
115 * |
|
116 * - if none of the three numbers is acceptted by host. |
|
117 * - iMinAvailableVbusCurrent, iMaxVbusCurrent and iMinVbusVoltage are 0 and iUsbConnStatus is EUsbConnectionStatusNone. |
|
118 */ |
|
119 EUsbChargingPortTypeStandardDownstreamPort, |
|
120 |
|
121 /** This device is connected to an ACA and ID pin status is RidA. |
|
122 * When ID pin status is RidA, this device works as A-device and is connected to an ACA. The ACA is connected with a charger |
|
123 * or a charging downstream port on ACA's charging port and may be connected to a B-device on ACA's accessory port. |
|
124 * The B-device can draw current from the charger. |
|
125 * iMinAvailableVbusCurrent is not more than 500mA. This value comes from 500mA (min IDCHG refer to in table 5-2 of BC1.1) minus the current that B-device |
|
126 * can draw. This value is maxpower field of B-device configuration descriptor. If there is no connected B-device, minus 0 from 500mA. |
|
127 * iMaxVbusCurrent is 1500mA (refer to max IDCHG in table 5-2 of BC1.1). For ACA can't distinguish a charger and a charging downstream |
|
128 * port so we select more contraint output. |
|
129 * iMinVbusVoltage is 2000mV (refer to VCHG_SHT_DWN in table 5-1 of BC1.1). |
|
130 * iUsbConnStatus is EUsbConnectionStatusNone. |
|
131 */ |
|
132 EUsbChargingPortTypeAcaRidA, |
|
133 |
|
134 /** This device is connected to an ACA and ID pin status is RidB |
|
135 * When ID pin status is RidB, this device works as a B-device and is connected to an ACA. The ACA is connected with a charger or a |
|
136 * charging downstream port on ACA's charging port. ACA may also be connected to A-device on accessory port but A-device VBUS |
|
137 * powers off. A-device shall not draw current from the accessory port. |
|
138 * iMinAvailableVbusCurrent is 500mA (refer to min IDCHG in table 5-2 of BC1.1). |
|
139 * iMaxVbusCurrent is 1500mA (refer to max IDCHG in table 5-2 of BC1.1). |
|
140 * iMinVbusVoltage is 2000mV (refer to VCHG_SHT_DWN in table 5-1 of BC1.1). |
|
141 * iUsbConnStatus is EUsbConnectionStatusNone. |
|
142 */ |
|
143 EUsbChargingPortTypeAcaRidB, |
|
144 |
|
145 /** This device is connected to an ACA and ID pin status is RidC |
|
146 * When ID pin status is RidC, this device work as a B-device and is connected to an ACA. The ACA is connected with a charger or |
|
147 * a charging downstream port on ACA's charging port and a A-device on accessory port. The A-device VBus powers on. A-device |
|
148 * shall not draw current from accessory port. |
|
149 * iMinAvailableVbusCurrent is 500mA (refer to min IDCHG in table 5-2 of BC1.1). |
|
150 * iMaxVbusCurrent is 1500mA (refer to max IDCHG in table 5-2 of BC1.1). |
|
151 * iMinVbusVoltage is 2000mV (refer to VCHG_SHT_DWN in table 5-1 of BC1.1). |
|
152 * iUsbConnStatus is EUsbConnectionStatusNone. |
|
153 */ |
|
154 EUsbChargingPortTypeAcaRidC |
|
155 }; |
|
156 |
|
157 /** |
|
158 * the P&S key category of published charing information. |
|
159 */ |
|
160 const TUid KPropertyUidUsbBatteryChargingCategory = {0x101fe1db}; |
|
161 |
|
162 /** |
|
163 * the P&S key ID of published charing information. |
|
164 */ |
|
165 const TUint KPropertyUidUsbBatteryChargingInfo = 1; |
|
166 |
|
167 /** |
|
168 * the structure of published charing information, data in P&S is a TPckgBuf wrappering this structure |
|
169 */ |
|
170 NONSHARABLE_STRUCT(TPublishedUsbChargingInfo) |
|
171 { |
|
172 /** the port type this device connects to. */ |
|
173 TUsbChargingPortType iChargingPortType; |
|
174 |
|
175 /** this field is only appliable when this device connects to a standard downstream port. */ |
|
176 TUsbConnectionStatus iUsbConnStatus; |
|
177 |
|
178 /** |
|
179 * This is the number of milliamps in unit 1 mA that can safely be drawn from VBUS |
|
180 * without needing to observe the VBUS level. |
|
181 */ |
|
182 TUint16 iMinAvailableVbusCurrent; |
|
183 |
|
184 /** |
|
185 * This is the number of milliamps that can be drawn from VBus in unit 1 mA. VBUS Level may drop down and must be monitored |
|
186 * to prevent VBUS Level drop below iMaxVbusCurrent. |
|
187 */ |
|
188 TUint16 iMaxVbusCurrent; |
|
189 |
|
190 /** VBUS Level must be above this number when charging and this number is in unit 1 mV. */ |
|
191 TUint16 iMinVbusVoltage; |
|
192 }; |
|
193 |
|
194 |
|
195 #endif // USBCHARGINGPUBLISHEDINFO_H |
|