wlan_plat/wlan_hpa_api/inc/wlanhpa.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  hpa and its client interface declarations
       
    15 *
       
    16 */ 
       
    17 
       
    18 /*
       
    19 * %version: 7 %
       
    20 */
       
    21 
       
    22 #ifndef WLANHPA_H
       
    23 #define WLANHPA_H
       
    24 
       
    25 #include <wlanosaplatform.h>
       
    26 #include <wlanosa.h>
       
    27 /**
       
    28  *  hpa client interface declaration
       
    29  *
       
    30  *
       
    31  *  @lib wlanpdd.pdd
       
    32  *  @since S60 v3.2
       
    33  */
       
    34 class MWlanHpaCb 
       
    35     {
       
    36 
       
    37 public:
       
    38 
       
    39 	/**
       
    40 	 * Destructor.
       
    41 	 *
       
    42 	 * @since S60 v3.2
       
    43 	 */
       
    44     virtual ~MWlanHpaCb() {};
       
    45 
       
    46     /**
       
    47      * Called in ISR DFC context to signal that peripheral 
       
    48      * device interrupt has occurred. 
       
    49      * NOTE: on systems implementing level sensitive interrupt handling
       
    50      * host interrupt is disabled prior calling this method
       
    51      *
       
    52      * @since S60 v3.2
       
    53      */    
       
    54     virtual void OnInterrupt() = 0;
       
    55 
       
    56     };
       
    57 
       
    58 class MWlanOsaExt;
       
    59 
       
    60 
       
    61 /**
       
    62  *  hpa interface declaration
       
    63  *
       
    64  *
       
    65  *  @lib wlanpdd.pdd
       
    66  *  @since S60 v3.2
       
    67  */
       
    68 class WlanHpa 
       
    69     {
       
    70 
       
    71 public:
       
    72 	 /* interrupt polarity */
       
    73 	enum TIsrPolarity
       
    74     	{
       
    75     	/** active high */
       
    76     	EIsrPolarityHigh = 0,
       
    77     	/** active low */
       
    78     	EIsrPolarityLow
       
    79     	};
       
    80 
       
    81 	struct TConfig
       
    82     	{
       
    83     	/* interrupt polarity */
       
    84     	TIsrPolarity iIsrPolarity;
       
    85     	};
       
    86 
       
    87 public:
       
    88 
       
    89 	/**
       
    90 	 * Destructor.
       
    91 	 *
       
    92 	 * @since S60 v3.2
       
    93 	 */
       
    94     virtual ~WlanHpa() {};
       
    95 
       
    96     /**
       
    97      * Create hpa layer object
       
    98      *
       
    99      * @since S60 v3.2
       
   100      * @param aOsaExt osa extension object
       
   101      * @return hpa layer object, NULL upon failure
       
   102      */
       
   103     IMPORT_C static WlanHpa* Create( MWlanOsaExt& aOsaExt, MWlanOsa& aOsa );
       
   104 
       
   105     /**
       
   106      * Destroy hpa layer object
       
   107      *
       
   108      * @since S60 v3.2
       
   109      * @param aWlanHpa hpa layer object
       
   110      */
       
   111     IMPORT_C static void Destroy( WlanHpa* aWlanHpa );
       
   112 
       
   113     /**
       
   114      * Attach hpa layer object client
       
   115      *
       
   116      * @since S60 v3.2
       
   117      * @param aHpaCb hpa layer object client
       
   118      */
       
   119     inline void Attach( MWlanHpaCb& aHpaCb );
       
   120     
       
   121     /**
       
   122      * Turns WLAN devices power on
       
   123      *
       
   124      * @since S60 v3.2
       
   125      */
       
   126     virtual void PowerOnDevice() = 0;
       
   127 
       
   128     /**
       
   129      * Turns WLAN devices power off
       
   130      *
       
   131      * @since S60 v3.2
       
   132      */
       
   133     virtual void PowerOffDevice() = 0;
       
   134 
       
   135     /**
       
   136      * Called by hpa layer object client when peripheral interrupt
       
   137      * informed by OnInterrupt method has been serviced.
       
   138      * NOTE: on systems implementing level sensitive interrupt handling
       
   139      * host interrupt is enabled at this state
       
   140      *
       
   141      * @since S60 v3.2
       
   142      */
       
   143     virtual void InterruptServiced() = 0;
       
   144     
       
   145     /**
       
   146      * Configures the HPA layer
       
   147      *
       
   148      * NOTE: usage limited to bootup sequence only
       
   149      *
       
   150      * @since S60 v3.2
       
   151      * @param aConfig HPA layer configuration data
       
   152      */
       
   153     virtual void Configure( const TConfig& aConfig ) = 0;
       
   154 
       
   155 	/**
       
   156 	 * Enables Irq
       
   157 	 *
       
   158 	 * NOTE: usage limited to bootup sequence only. 
       
   159 	 * Untill this call the host side interrupts are disabled
       
   160 	 *
       
   161 	 * @since S60 v3.2
       
   162 	 */
       
   163 	 virtual void EnableIrq() = 0;
       
   164 	 
       
   165 	 /**
       
   166 	 * Toggles debug GPIO
       
   167 	 * Usage limited to R&D (debug) purpose only
       
   168 	 *
       
   169 	 * @since S60 v3.2
       
   170 	 * @param aHigh state to set (ETrue equals high state otherwise low state)
       
   171 	 * @return ETrue equals functionality is supported in any other case not supported
       
   172 	 */
       
   173 	 virtual TBool DebugGpioToggle( TBool aHigh ) = 0;
       
   174 
       
   175 protected:
       
   176 
       
   177     /**
       
   178      * Constructor 
       
   179      *
       
   180      * @since S60 v3.2
       
   181      * @param aOsaExt osa extension object
       
   182      */
       
   183     explicit WlanHpa( MWlanOsaExt& aOsaExt, MWlanOsa& aOsa ) 
       
   184         : iHpaCb( NULL ), iOsaExt( aOsaExt ), iOsa( aOsa ) {};
       
   185 
       
   186     /**
       
   187      * Extract hpa layer object client
       
   188      *
       
   189      * @since S60 v3.2
       
   190      * @return hpa layer object client
       
   191      */
       
   192     inline MWlanHpaCb& HpaCb();
       
   193 
       
   194     /**
       
   195      * Extract osa extension
       
   196      *
       
   197      * @since S60 v3.2
       
   198      * @return osa extension
       
   199      */
       
   200     inline MWlanOsaExt& OsaExtCb();
       
   201 
       
   202     /**
       
   203      * Extract osa
       
   204      *
       
   205      * @since 
       
   206      * @return osa
       
   207      */
       
   208     
       
   209     inline MWlanOsa& OsaCb();
       
   210 
       
   211 private:
       
   212 
       
   213     /**
       
   214      * hpa layer object client
       
   215      * Not own.  
       
   216      */
       
   217     MWlanHpaCb*     iHpaCb;
       
   218 
       
   219     /**
       
   220      * osa extension
       
   221      */
       
   222     MWlanOsaExt&    iOsaExt;
       
   223     
       
   224      /**
       
   225      * osa
       
   226      */
       
   227     MWlanOsa&    iOsa;
       
   228     
       
   229     };
       
   230 
       
   231 #include <wlanhpa.inl>
       
   232 
       
   233 #endif // WLANHPA_H