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