|
1 /* |
|
2 light_chipset_api.h |
|
3 |
|
4 Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
5 All rights reserved. |
|
6 |
|
7 This program and the accompanying materials are made available |
|
8 under the terms of the Eclipse Public License v1.0 which accompanies |
|
9 this distribution, and is available at |
|
10 http://www.eclipse.org/legal/epl-v10.html |
|
11 |
|
12 Initial Contributors: |
|
13 Nokia Corporation - initial contribution. |
|
14 |
|
15 Contributors: |
|
16 */ |
|
17 |
|
18 /** @file |
|
19 @brief Light Chipset API H |
|
20 |
|
21 This is the header file for Light Chipset API that is used to access |
|
22 the light service provided by the third party chipset vendor. |
|
23 |
|
24 @publishedDeviceAbstraction |
|
25 */ |
|
26 |
|
27 #ifndef __LIGHT_CHIPSET_API_H__ |
|
28 #define __LIGHT_CHIPSET_API_H__ |
|
29 |
|
30 // Include files |
|
31 |
|
32 #include <kern_priv.h> |
|
33 |
|
34 |
|
35 // Constants |
|
36 |
|
37 |
|
38 // Macros |
|
39 |
|
40 |
|
41 // Data types |
|
42 |
|
43 /** |
|
44 * RGB values. |
|
45 * |
|
46 */ |
|
47 |
|
48 struct TLightColor |
|
49 { |
|
50 TUint8 iRed; |
|
51 TUint8 iGreen; |
|
52 TUint8 iBlue; |
|
53 }; |
|
54 |
|
55 // Function prototypes |
|
56 |
|
57 |
|
58 // Class declaration |
|
59 |
|
60 /** |
|
61 This class defines the Chipset API that is used to access |
|
62 the light service provided by the third party chipset vendor. |
|
63 */ |
|
64 class LightService |
|
65 { |
|
66 public: |
|
67 |
|
68 /** |
|
69 This method is used to do all the necessary initialization so |
|
70 that the chipset is ready to provide the light service. |
|
71 |
|
72 @return Symbian OS system wide error code, and the followings are required: |
|
73 KErrNone – the operation is successfully executed |
|
74 KErrGeneral – error condition |
|
75 KErrAlreadyExists – if trying to initialize twice |
|
76 |
|
77 @pre Pre-condition, it should be called first before the other methods of this class are used |
|
78 */ |
|
79 IMPORT_C static TInt Init(); |
|
80 |
|
81 /** |
|
82 This function is used to set the specified output to the desired intensity. |
|
83 |
|
84 @param aOutputId The identity of the output line that shall be controlled |
|
85 @param aIntensity The desired intensity of the light with range 0 – 10000 [1/100%] |
|
86 |
|
87 @return Symbian OS system wide error code, and the followings are required: |
|
88 KErrNone – the operation is successfully executed |
|
89 KErrGeneral – error condition |
|
90 KErrNotReady –if trying to access uninitialized device |
|
91 KErrNotSupported – if the feature is not supported by the HW |
|
92 |
|
93 @pre Pre-condition, the method Init() has been executed successfully |
|
94 */ |
|
95 IMPORT_C static TInt SetIntensity(TUint aOutputId, TUint16 aIntensity); |
|
96 |
|
97 /** |
|
98 This function is used to set the specified output to the desired PWM frequency. |
|
99 |
|
100 @param aOutputId The identity of the output line that shall be controlled |
|
101 @param aFrequency The PWM frequency from 0 to the maximum frequency available from the chipset (range 0 to 65535Hz) |
|
102 |
|
103 @return Symbian OS system wide error code, and the followings are required: |
|
104 KErrNone – the operation is successfully executed |
|
105 KErrGeneral – error condition |
|
106 KErrNotReady – if trying to access uninitialized device |
|
107 KErrNotSupported – if the feature is not supported by the HW |
|
108 |
|
109 @pre Pre-condition, the method Init() has been executed successfully |
|
110 */ |
|
111 IMPORT_C static TInt SetFrequency(TUint aOutputId, TUint16 aFrequency); |
|
112 /** |
|
113 This function is used to set the color of the LED target. |
|
114 |
|
115 @param aOutputId The identity of the output line that shall be controlled |
|
116 @param TLightColor The Light color structure to specify RGB values |
|
117 |
|
118 @return Symbian OS system wide error code, and the followings are required: |
|
119 KErrNone – the operation is successfully executed |
|
120 KErrGeneral – error condition |
|
121 KErrNotReady – if trying to access uninitialized device |
|
122 KErrNotSupported – if the feature is not supported by the HW |
|
123 |
|
124 @pre Pre-condition, the method Init() has been executed successfully |
|
125 */ |
|
126 IMPORT_C static TInt SetColor(TUint aOutputId, TLightColor aRGB); |
|
127 |
|
128 }; |
|
129 |
|
130 #endif // __LIGHT_CHIPSET_API_H__ |