GAPE/gape_chipset_api.h
changeset 5 ef85d0a8d402
parent 0 bb4b476bbb96
equal deleted inserted replaced
4:acd095fadba0 5:ef85d0a8d402
     1 /*
     1 /*
     2   gptimer_chipset_api.h
     2 Nokia/Devices/R&D/SD/SSS
       
     3 CONFIDENTIAL
       
     4 Deliverable software
     3 
     5 
     4   Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     5   All rights reserved.
       
     6 
     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 
     7 
    12   Initial Contributors:
     8             GAPE_CHIPSET_API.H
    13   Nokia Corporation - initial contribution.
     9             --------------------------------
    14 
    10 
    15   Contributors:
    11             SW Include Document - Symbian OS
       
    12 
       
    13 
       
    14 
       
    15 Document identification and location in Synergy/CM
       
    16 
       
    17 Database:           ...
       
    18 
       
    19 Object (this information is substituted by Synergy/CM):
       
    20     %name:           %
       
    21     %cvtype:         %
       
    22     %instance:       %
       
    23     %version:        %
       
    24     %date_modified:  %
       
    25 
       
    26 Copyright (c) Nokia. This material, including documentation and any related
       
    27 computer programs, is protected by copyright controlled by Nokia.
       
    28 All rights are reserved. Copying, including reproducing, storing, adapting or
       
    29 translating, any or all of this material requires the prior written consent
       
    30 of Nokia. This material also contains confidential information, which may not
       
    31 be disclosed to others without the prior written consent of Nokia.
    16 */
    32 */
    17 
    33 
    18 /** @file
    34 /** @file
    19 @brief gape_chipset_api.h
    35 @brief gape_chipset_api.h
    20 
    36 
    27 #define __GAPE_H__
    43 #define __GAPE_H__
    28 
    44 
    29 // Include files
    45 // Include files
    30 
    46 
    31 #include <kern_priv.h>
    47 #include <kern_priv.h>
    32 
    48 #include <gape_descriptors.h>
    33 // Constants
    49 // Constants
    34 
    50 // defined in gape_descriptors.h
    35 /* The list of the descriptor names what the array can hold */
       
    36 _LIT8( KTvOut, "TvOut" );
       
    37 _LIT8( KKeypad, "Keypad" );
       
    38 _LIT8( KNand, "Nand" );
       
    39 _LIT8( KPrimaryDisplay, "PriDisp" );
       
    40 _LIT8( KSecondaryDisplay, "SecDisp" );
       
    41 _LIT8( KSecurity, "Security" );
       
    42 _LIT8( KUsbExt, "UsbExtension" );
       
    43 _LIT8( KUsbDriver, "UsbDriver" );
       
    44 _LIT8( KDigitiser, "Digitiser" );
       
    45 _LIT8( KMmc, "Mmc" );
       
    46 _LIT8( KSd, "Sd" );
       
    47 _LIT8( KHdd, "Hdd" );
       
    48 _LIT8( KCustom, "Custom" );
       
    49 _LIT8( KJoystick, "Joystick" );
       
    50 _LIT8( KLight, "Light" );
       
    51 _LIT8( KSwitch, "Switch" );
       
    52 _LIT8( KQwerty, "Qwerty" );
       
    53 _LIT8( KPanicScreen, "PanicScreen" );
       
    54 _LIT8( KBootFigure0, "BootFigure0" );
       
    55 _LIT8( KBootFigure1, "BootFigure1" );
       
    56 _LIT8( KThermalSensor, "ThermalSensor" );
       
    57 _LIT8( KCameraHWA, "CameraHWA" );
       
    58 _LIT8( KCameraDriver, "CameraDriver" );
       
    59 _LIT8( KDisplayDriver, "DisplayDriver" );
       
    60 _LIT8( KPowerModel, "PowerController" );
       
    61 _LIT8( KTwistDriver, "TwistDriver" );
       
    62 _LIT8( KCameraStaticData, "CameraStaticData" );
       
    63 _LIT8( KAccelerometer, "Accelerometer" );
       
    64 _LIT8( KExpander, "KeypadExpander" );
       
    65 _LIT8( KPowerTouareg, "PowerTouareg" );
       
    66 _LIT8( KKernelDataTransferApiUsb, "UsbDataIf" );
       
    67 _LIT8( KNaviScroll, "NaviScroll" );
       
    68 _LIT8( KTouchIC, "TouchIC" );
       
    69 
       
    70 /** Array for pointers (for registered descriptors) */
       
    71 const TDesC8* const KPtrArray[] =
       
    72     {
       
    73     &KTvOut,
       
    74     &KKeypad,
       
    75     &KNand,
       
    76     &KPrimaryDisplay,
       
    77     &KSecondaryDisplay,
       
    78     &KSecurity,
       
    79     &KUsbExt,
       
    80     &KUsbDriver,
       
    81     &KDigitiser,
       
    82     &KMmc,
       
    83     &KSd,
       
    84     &KHdd,
       
    85     &KCustom,
       
    86     &KJoystick,
       
    87     &KLight,
       
    88     &KSwitch,
       
    89     &KQwerty,
       
    90     &KPanicScreen,
       
    91     &KBootFigure0,
       
    92     &KBootFigure1,
       
    93     &KThermalSensor,
       
    94     &KCameraHWA,
       
    95     &KCameraDriver,
       
    96     &KDisplayDriver,
       
    97     &KPowerModel,
       
    98     &KCameraStaticData,
       
    99     &KAccelerometer,
       
   100     &KExpander,
       
   101     &KPowerTouareg,
       
   102     &KKernelDataTransferApiUsb,
       
   103     &KNaviScroll,
       
   104     &KTouchIC
       
   105     };
       
   106 
       
   107 /** Maximum number of items in an array */
       
   108 const TUint KPtrArraySize = ( sizeof( KPtrArray ) / sizeof( KPtrArray[0] ) );
       
   109 
    51 
   110 // Macros
    52 // Macros
   111 
    53 
   112 // Data types
    54 // Data types
   113 
    55 
   131             Return an instance to GApe interface. This method returns the
    73             Return an instance to GApe interface. This method returns the
   132             only GApe instance system can have, it is not possible to create
    74             only GApe instance system can have, it is not possible to create
   133             new instances of this class.
    75             new instances of this class.
   134 
    76 
   135             @return GApe* An instance to GApe class
    77             @return GApe* An instance to GApe class
       
    78             @pre Pre-condition: do not call from an ISR
   136         */
    79         */
   137         static GApe* Instance();
    80         static GApe* Instance();
   138 
    81 
   139         /**
    82         /**
   140             Save pointer to internal array e.g.
    83             Save pointer to internal array e.g.
   141 
       
   142             @code
       
   143             TInt ret = GApe::SetPtr( KTvOut, this );
       
   144             if ( ret != KErrNone )
       
   145                 {
       
   146                 // Error handling...
       
   147                 }
       
   148             @endcode
       
   149 
    84 
   150             @param  aName   Name used for registering pointer
    85             @param  aName   Name used for registering pointer
   151             @param  aPtr    Pointer to be saved
    86             @param  aPtr    Pointer to be saved
   152 
    87 
   153             @return KErrNone, if successful. KErrAlreadyExists, if the pointer
    88             @return KErrNone, if successful. KErrAlreadyExists, if the pointer
   154                     is already registered. KErrNotFound, if the 'aName' is not
    89                     is already registered. KErrNotFound, if the 'aName' is not
   155                     a valid name.
    90                     a valid name.
       
    91             @pre Pre-condition: Call in any context        
   156         */
    92         */
   157         IMPORT_C static TInt SetPtr(const TDesC8& aName, TAny* const aPtr);
    93         IMPORT_C static TInt SetPtr(const TDesC8& aName, TAny* const aPtr);
   158 
    94 
   159         /**
    95         /**
   160             Get pointer from internal array e.g.
    96             Get pointer from internal array e.g.
   161 
    97 
   162             @code
       
   163             DTvOut* tvout = static_cast<DTvOut*>( GApe::GetPtr( KTvOut ) );
       
   164             if ( tvout )
       
   165                 {
       
   166                 // Usage...
       
   167                 }
       
   168             @endcode
       
   169 
       
   170             @param  aName   Name of the registered pointer
    98             @param  aName   Name of the registered pointer
   171 
    99 
   172             @return Pointer to requested item. May also return NULL, which
   100             @return Pointer to requested item. May also return NULL, which
   173                     indicates that the pointer is not registered or the name
   101                     indicates that the pointer is not registered or the name
   174                     is not valid.
   102                     is not valid.
       
   103             @pre Pre-condition: Call in any context          
   175         */
   104         */
   176         IMPORT_C static TAny* GetPtr(const TDesC8& aName);
   105         IMPORT_C static TAny* GetPtr(const TDesC8& aName);
   177 
   106 
   178     private:
   107     private:
   179         /**
   108         /**