16 */ |
16 */ |
17 |
17 |
18 #ifndef __devicePDD_H__ |
18 #ifndef __devicePDD_H__ |
19 #define __devicePDD_H__ |
19 #define __devicePDD_H__ |
20 |
20 |
|
21 #ifndef __deviceIF_H__ |
|
22 #include <webcamera_driver.h> |
|
23 #endif |
21 #include <comm.h> |
24 #include <comm.h> |
22 #include <e32hal.h> |
25 #include <e32hal.h> |
23 #include "system.h" |
26 #include "system.h" |
|
27 #ifndef __deviceBASE_H |
24 #include "webcamera_device.h" |
28 #include "webcamera_device.h" |
|
29 #endif |
|
30 #ifndef WEBCAMERA_UVC_H_ |
|
31 #include "webcamera_uvc.h" |
|
32 #endif |
25 |
33 |
26 const TInt KMinimumLddMajorVersion=1; |
34 const TInt KMinimumLddMajorVersion = 1; |
27 const TInt KMinimumLddMinorVersion=1; |
35 const TInt KMinimumLddMinorVersion = 1; |
28 const TInt KMinimumLddBuild=0; |
36 const TInt KMinimumLddBuild = 0; |
29 const TInt EIrqWebamera=0xb; |
37 const TInt EIrqWebamera = 0xb; |
30 |
38 |
31 class DWebcameraPddFactory : public DPhysicalDevice |
39 class DWebcameraPddFactory : public DPhysicalDevice |
32 { |
40 { |
33 public: |
41 public: |
34 /** |
42 /** |
35 Constructor |
43 Constructor |
36 */ |
44 */ |
37 DWebcameraPddFactory(); |
45 DWebcameraPddFactory(); |
38 |
46 |
39 virtual TInt Install(); |
47 virtual TInt Install(); |
40 virtual void GetCaps(TDes8 &aDes) const; |
48 virtual void GetCaps(TDes8 &aDes) const; |
41 virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* anInfo, const TVersion &aVer); |
49 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); |
50 virtual TInt Validate(TInt aUnit, const TDesC8* anInfo, const TVersion &aVer); |
43 }; |
51 }; |
44 |
|
45 |
52 |
46 class DWebcameraDriver : public DWebcameraDriverBase |
53 class DWebcameraDriver : public DWebcameraDriverBase |
47 { |
54 { |
48 public: |
55 public: |
49 /** |
56 /** |
50 Constructor |
57 Chunk index. |
|
58 */ |
|
59 enum TWebcameraIndex |
|
60 { |
|
61 EWEBCAMERAINDEXHAHEADERBUF, |
|
62 EWEBCAMERAINDEXADATABUF, |
|
63 EWEBCAMERAINDEXMAX |
|
64 }; |
|
65 |
|
66 /** |
|
67 Constructor |
51 */ |
68 */ |
52 DWebcameraDriver(); |
69 DWebcameraDriver(); |
|
70 |
53 /** |
71 /** |
54 Destructor |
72 Destructor |
55 */ |
73 */ |
56 ~DWebcameraDriver(); |
74 ~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 |
75 |
62 @param aUnit The unit argument supplied by the client |
76 /** |
63 @param aInfo The info argument supplied by the client |
77 Second stage constructor called by the kernel's device driver framework. |
|
78 This is called in the context of the user thread (client) which requested the creation of a Logical Channel |
|
79 The thread is in a critical section. |
64 |
80 |
65 @return KErrNone if successful, otherwise one of the other system wide error codes. |
81 @param aUnit The unit argument supplied by the client |
66 */ |
82 @param aInfo The info argument supplied by the client |
|
83 @return KErrNone if successful, otherwise one of the other system wide error codes. |
|
84 */ |
67 TInt DoCreate(TInt aUnit, const TDesC8* anInfo); |
85 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 |
86 |
72 @param aBuffer physical adress |
87 /** |
73 @param aData size of buffer. |
88 Power on Camera Device. |
74 */ |
89 */ |
75 virtual TInt StartViewerFinder(TUint aBuffer,TInt aSize); |
90 virtual TInt PowerOn(TAny* aHeaderPtr); |
76 /** |
|
77 Request data from device. |
|
78 Only one send request may be pending at any time. |
|
79 |
91 |
80 @param aBuffer physical adress |
92 /** |
81 @param aData size of buffer. |
93 Init ViewFinder. |
82 */ |
94 */ |
83 virtual TInt StartCapture(TUint aBuffer,TInt aSize); |
95 virtual TInt InitViewFinder(); |
84 /** |
|
85 Request device not to send data. |
|
86 Only one send request may be pending at any time. |
|
87 |
96 |
88 @param aMode stop mode |
97 /** |
89 */ |
98 Request data from device. |
|
99 Only one send request may be pending at any time. |
|
100 |
|
101 @param aBuffer physical adress |
|
102 @param aData size of buffer. |
|
103 */ |
|
104 virtual TInt StartViewerFinder(TAny* aDataPtr, TInt aSize); |
|
105 |
|
106 /** |
|
107 Request device not to send data. |
|
108 Only one send request may be pending at any time. |
|
109 |
|
110 @param aMode stop mode |
|
111 */ |
90 virtual void Stop(TUSBStopMode aMode); |
112 virtual void Stop(TUSBStopMode aMode); |
|
113 |
|
114 /** |
|
115 Disconnect on Camera Device. |
|
116 */ |
|
117 virtual void Disconnect(); |
|
118 |
91 // virtual void Caps(TDes8 &aCaps) const; |
119 // virtual void Caps(TDes8 &aCaps) const; |
|
120 |
92 /** |
121 /** |
93 Called by ISR to indicate that interrupt occurs. |
122 Called by ISR to indicate that interrupt occurs. |
94 */ |
123 */ |
95 static void Isr(TAny* aPtr); |
124 static void Isr(TAny* aPtr); |
96 /** |
125 |
97 Called from a Isr after the Peripheral has signalled that getting oneflame completed. |
126 /** |
98 */ |
127 Called from a Isr after the Peripheral has signalled that getting oneflame completed. |
|
128 */ |
99 void receivedatacallback(); |
129 void receivedatacallback(); |
100 |
130 |
|
131 /** |
|
132 Chunk Create (Local use). |
|
133 */ |
|
134 TInt CreateChunk(TInt aSize, TWebcameraIndex aIndex); |
|
135 |
|
136 /** |
|
137 Chunk Close (Local use). |
|
138 */ |
|
139 void CloseChunk(TWebcameraIndex aIndex); |
|
140 |
101 public: |
141 public: |
102 /** |
142 /** |
103 Enumeration of register types. |
143 Enumeration of register types. |
104 */ |
144 */ |
105 enum { |
145 enum |
106 WEBCAMERA_REG_ID = 0, |
146 { |
107 WEBCAMERA_REG_INT_ENABLE = 1, |
147 WEBCAMERA_REG_ID = 0, |
108 WEBCAMERA_REG_DATA_TYPE = 2, |
148 WEBCAMERA_REG_INT_ENABLE = 1, |
109 WEBCAMERA_REG_DMA_ADDR = 3, |
149 WEBCAMERA_REG_DATA_TYPE = 2, |
110 WEBCAMERA_REG_DMA_SIZE = 4 |
150 WEBCAMERA_REG_DMA_ADDR = 3, |
111 }; |
151 WEBCAMERA_REG_DMA_SIZE = 4, |
|
152 WEBCAMERA_REG_DMA_INFO = 5, |
|
153 WEBCAMERA_REG_DMA_INFOSIZE = 6, |
|
154 WEBCAMERA_REG_DMA_CONNECT = 7, |
|
155 WEBCAMERA_REG_DMA_DISCONNECT = 8 |
|
156 }; |
112 |
157 |
113 private: |
158 private: |
114 /** |
159 /** |
115 operation types. |
160 operation types. |
116 */ |
161 */ |
117 TInt iType; |
162 TInt iType; |
118 }; |
163 TWebcameraDataInfo iDataInfo; |
|
164 DChunk* iChunk[EWEBCAMERAINDEXMAX]; ///< For Chunk process. |
|
165 DThread* iClient; |
|
166 TUint32 iPhysAddr[EWEBCAMERAINDEXMAX]; |
|
167 TWebcameraUVC iUvcData; |
|
168 }; |
119 |
169 |
120 #endif |
170 #endif |