Light/light_chipset_api.h
changeset 0 bb4b476bbb96
equal deleted inserted replaced
-1:000000000000 0:bb4b476bbb96
       
     1 /*
       
     2   light_chipset_api.h
       
     3 
       
     4   Copyright (c) 2009 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 // Function prototypes
       
    45 
       
    46 
       
    47 // Class declaration
       
    48 
       
    49 /**
       
    50 This class defines the Chipset API that is used to access 
       
    51 the light service provided by the third party chipset vendor.
       
    52 */
       
    53 class LightService
       
    54     {
       
    55     public:
       
    56 
       
    57         /**
       
    58         This method is used to do all the necessary initialization so 
       
    59         that the chipset is ready to provide the light service.
       
    60 
       
    61         @return Symbian OS system wide error code, and the followings are required: 
       
    62                 KErrNone – the operation is successfully executed
       
    63                 KErrGeneral – error condition
       
    64                 KErrAlreadyExists – if trying to initialize twice
       
    65 
       
    66         @pre Pre-condition, it should be called first before the other methods of this class are used 
       
    67         */
       
    68         IMPORT_C static TInt Init();
       
    69 
       
    70         /**
       
    71         This function is used to set the specified output to the desired intensity.
       
    72 
       
    73         @param aOutputId The identity of the output line that shall be controlled
       
    74         @param aIntensity	The desired intensity of the light with range 0 – 10000 [1/100%]
       
    75 
       
    76         @return Symbian OS system wide error code, and the followings are required: 
       
    77                 KErrNone – the operation is successfully executed
       
    78                 KErrGeneral – error condition
       
    79                 KErrNotReady –if trying to access uninitialized device
       
    80                 KErrNotSupported – if the feature is not supported by the HW
       
    81 
       
    82         @pre Pre-condition, the method Init() has been executed successfully
       
    83         */
       
    84         IMPORT_C static TInt SetIntensity(TUint aOutputId, TUint16 aIntensity);
       
    85 
       
    86         /**
       
    87         This function is used to set the specified output to the desired current.
       
    88 
       
    89         @param aOutputId The identity of the output line that shall be controlled
       
    90         @param aCurrent	The driving current from 0 to the maximum current available from the chipset [1/10 mA] (range 0.0 to 6553.5mA)
       
    91 
       
    92         @return Symbian OS system wide error code, and the followings are required: 
       
    93                 KErrNone – the operation is successfully executed
       
    94                 KErrGeneral – error condition
       
    95                 KErrNotReady – if trying to access uninitialized device
       
    96                 KErrNotSupported – if the feature is not supported by the HW
       
    97 
       
    98         @pre Pre-condition, the method Init() has been executed successfully
       
    99         */
       
   100         IMPORT_C static TInt SetCurrent(TUint aOutputId, TUint16 aCurrent);
       
   101 
       
   102         /**
       
   103         This function is used to set the specified output to the desired PWM frequency.
       
   104 
       
   105         @param aOutputId The identity of the output line that shall be controlled
       
   106         @param aFrequency	The PWM frequency from 0 to the maximum frequency available from the chipset (range 0 to 65535Hz)
       
   107 
       
   108         @return Symbian OS system wide error code, and the followings are required: 
       
   109                 KErrNone – the operation is successfully executed
       
   110                 KErrGeneral – error condition
       
   111                 KErrNotReady – if trying to access uninitialized device
       
   112                 KErrNotSupported – if the feature is not supported by the HW
       
   113 
       
   114         @pre Pre-condition, the method Init() has been executed successfully
       
   115         */
       
   116         IMPORT_C static TInt SetFrequency(TUint aOutputId, TUint16 aFrequency);
       
   117 
       
   118     };
       
   119 
       
   120 #endif // __LIGHT_CHIPSET_API_H__