baseport/syborg/webcamera/webcamera_pdd.h
changeset 52 0dfaca43d90e
equal deleted inserted replaced
51:457d682728ee 52:0dfaca43d90e
       
     1 /*
       
     2 * Copyright (c) 2010 ISB.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "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 * ISB - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __devicePDD_H__
       
    19 #define __devicePDD_H__
       
    20 
       
    21 #include <comm.h>
       
    22 #include <e32hal.h>
       
    23 #include "system.h"
       
    24 #include "webcamera_device.h"
       
    25 
       
    26 const TInt KMinimumLddMajorVersion=1;
       
    27 const TInt KMinimumLddMinorVersion=1;
       
    28 const TInt KMinimumLddBuild=0;
       
    29 const TInt EIrqWebamera=0xb;
       
    30 
       
    31 class DWebcameraPddFactory : public DPhysicalDevice
       
    32 {
       
    33 public:
       
    34 	/**
       
    35 	  Constructor
       
    36 	*/
       
    37 	DWebcameraPddFactory();
       
    38 	
       
    39 	virtual TInt Install();
       
    40 	virtual void GetCaps(TDes8 &aDes) const;
       
    41 	virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* anInfo, const TVersion &aVer);
       
    42 	virtual TInt Validate(TInt aUnit, const TDesC8* anInfo, const TVersion &aVer);
       
    43 };
       
    44 
       
    45 
       
    46 class DWebcameraDriver : public DWebcameraDriverBase
       
    47 {
       
    48 public:
       
    49 	/**
       
    50 	  Constructor
       
    51 	*/
       
    52 	DWebcameraDriver();
       
    53 	/**
       
    54 	  Destructor
       
    55 	*/
       
    56 	~DWebcameraDriver();
       
    57     /**
       
    58       Second stage constructor called by the kernel's device driver framework.
       
    59       This is called in the context of the user thread (client) which requested the creation of a Logical Channel
       
    60       The thread is in a critical section.
       
    61 
       
    62       @param aUnit The unit argument supplied by the client
       
    63       @param aInfo The info argument supplied by the client
       
    64 
       
    65       @return KErrNone if successful, otherwise one of the other system wide error codes.
       
    66     */
       
    67 	TInt DoCreate(TInt aUnit, const TDesC8* anInfo);
       
    68     /**
       
    69       Request data from device.
       
    70       Only one send request may be pending at any time.
       
    71 
       
    72       @param  aBuffer physical adress
       
    73       @param aData   size of buffer.
       
    74     */
       
    75 	virtual TInt StartViewerFinder(TUint aBuffer,TInt aSize);
       
    76     /**
       
    77       Request data from device.
       
    78       Only one send request may be pending at any time.
       
    79 
       
    80       @param  aBuffer physical adress
       
    81       @param aData   size of buffer.
       
    82     */
       
    83 	virtual TInt StartCapture(TUint aBuffer,TInt aSize);
       
    84     /**
       
    85       Request device not to send data.
       
    86       Only one send request may be pending at any time.
       
    87 
       
    88       @param  aMode stop mode
       
    89     */
       
    90 	virtual void Stop(TUSBStopMode aMode);
       
    91 //	virtual void Caps(TDes8 &aCaps) const;
       
    92 	/**
       
    93 	  Called by ISR to indicate that interrupt occurs.
       
    94 	*/
       
    95 	static void Isr(TAny* aPtr);
       
    96     /**
       
    97       Called from a Isr after the Peripheral has signalled that getting oneflame completed.
       
    98     */
       
    99 	void receivedatacallback();
       
   100 
       
   101 public:
       
   102 	  /**
       
   103 	  Enumeration of register types.
       
   104 	  */
       
   105   enum {
       
   106 		WEBCAMERA_REG_ID           = 0,
       
   107 		WEBCAMERA_REG_INT_ENABLE   = 1,
       
   108 		WEBCAMERA_REG_DATA_TYPE    = 2,
       
   109 		WEBCAMERA_REG_DMA_ADDR     = 3,
       
   110 		WEBCAMERA_REG_DMA_SIZE     = 4
       
   111 	    };
       
   112 
       
   113 private:
       
   114     /**
       
   115     operation types.
       
   116     */
       
   117 	TInt iType;
       
   118 };
       
   119 
       
   120 #endif