Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1702 | - | 1 | /* Copyright (C) 2010-2011 Circuits At Home, LTD. All rights reserved. |
2 | |||
3 | This software may be distributed and modified under the terms of the GNU |
||
4 | General Public License version 2 (GPL2) as published by the Free Software |
||
5 | Foundation and appearing in the file GPL2.TXT included in the packaging of |
||
6 | this file. Please note that GPL2 Section 2[b] requires that all works based |
||
7 | on this software must also be made publicly available under the terms of |
||
8 | the GPL2 ("Copyleft"). |
||
9 | |||
10 | Contact information |
||
11 | ------------------- |
||
12 | |||
13 | Circuits At Home, LTD |
||
14 | Web : http://www.circuitsathome.com |
||
15 | e-mail : support@circuitsathome.com |
||
16 | */ |
||
17 | #ifndef __CANONPS_H__ |
||
18 | #define __CANONPS_H__ |
||
19 | |||
20 | #include "ptp.h" |
||
21 | |||
22 | // PTP Operation Codes (PowerShot specific) |
||
23 | #define PS_OC_GetObjectSize 0x9001 |
||
24 | #define PS_OC_StartShootingMode 0x9008 |
||
25 | #define PS_OC_EndShootingMode 0x9009 |
||
26 | #define PS_OC_ViewfinderOn 0x900B |
||
27 | #define PS_OC_ViewfinderOff 0x900C |
||
28 | #define PS_OC_ReflectChanges 0x900D |
||
29 | #define PS_OC_CheckEvent 0x9013 |
||
30 | #define PS_OC_FocusLock 0x9014 |
||
31 | #define PS_OC_FocusUnlock 0x9015 |
||
32 | #define PS_OC_InitiateCaptureInMemory 0x901A |
||
33 | #define PS_OC_GetPartialObject 0x901B |
||
34 | #define PS_OC_GetViewfinderImage 0x901d |
||
35 | #define PS_OC_GetChanges 0x9020 |
||
36 | #define PS_OC_GetFolderEntries 0x9021 |
||
37 | |||
38 | // PTP PowerShot Extention Events |
||
39 | #define PS_EC_ShutDownCFDoorWasOpened 0xC001 /* The Device has shut down due to the opening of the SD card cover.*/ |
||
40 | #define PS_EC_ResetHwError 0xC005 /* The device has generated a hardware error. */ |
||
41 | #define PS_EC_AbortPCEvf 0xC006 /* The Viewfinder mode has been cancelled. */ |
||
42 | #define PS_EC_EnablePCEvf 0xC007 /* The Viewfinder mode has been enablede. */ |
||
43 | #define PS_EC_FullViewReleased 0xC008 /* Transfer timing of main image data */ |
||
44 | #define PS_EC_ThumbnailReleased 0xC009 /* Transfer timing of thumbnail image data */ |
||
45 | #define PS_EC_ChangeBatteryStatus 0xC00A /* The power condition of the camera has changed. */ |
||
46 | #define PS_EC_PushedReleaseSw 0xC00B /* User has pressed the release swtich on camera. */ |
||
47 | #define PS_EC_PropertyChanged 0xC00C /* A group of properties relating to release control have been changed. */ |
||
48 | #define PS_EC_RotationAngleChanged 0xC00D /* The angle of rotation of the camera has been changed. */ |
||
49 | #define PS_EC_ChangedByCamUI 0xC00E /* An operation control on the camera has been operated.*/ |
||
50 | #define PS_EC_Shutdown 0xD001 /* Shutdown */ |
||
51 | #define PS_EC_StartDirectTransfer 0xC011 |
||
52 | #define PS_EC_StopDirectTransfer 0xC013 |
||
53 | |||
54 | // PowerShot-specific Device Properties |
||
55 | #define PS_DPC_BeepMode 0xD001 |
||
56 | #define PS_DPC_BatteryKind 0xD002 |
||
57 | #define PS_DPC_BatteryStatus 0xD003 |
||
58 | #define PS_DPC_UILockType 0xD004 |
||
59 | #define PS_DPC_CameraMode 0xD005 |
||
60 | #define PS_DPC_ImageQuality 0xD006 |
||
61 | #define PS_DPC_FullViewFileFormat 0xD007 |
||
62 | #define PS_DPC_ImageSize 0xD008 |
||
63 | #define PS_DPC_SelfTime 0xD009 |
||
64 | #define PS_DPC_FlashMode 0xD00A |
||
65 | #define PS_DPC_Beep 0xD00B |
||
66 | #define PS_DPC_ShootingMode 0xD00C |
||
67 | #define PS_DPC_ImageMode 0xD00D |
||
68 | #define PS_DPC_DriveMode 0xD00E |
||
69 | #define PS_DPC_EZoom 0xD00F |
||
70 | #define PS_DPC_MeteringMode 0xD010 |
||
71 | #define PS_DPC_AFDistance 0xD011 |
||
72 | #define PS_DPC_FocusingPoint 0xD012 |
||
73 | #define PS_DPC_WhiteBalance 0xD013 |
||
74 | #define PS_DPC_SlowShutterSetting 0xD014 |
||
75 | #define PS_DPC_AFMode 0xD015 |
||
76 | #define PS_DPC_ImageStabilization 0xD016 |
||
77 | #define PS_DPC_Contrast 0xD017 |
||
78 | #define PS_DPC_ColorGain 0xD018 |
||
79 | #define PS_DPC_Sharpness 0xD019 |
||
80 | #define PS_DPC_Sensitivity 0xD01A |
||
81 | #define PS_DPC_ParameterSet 0xD01B |
||
82 | #define PS_DPC_ISOSpeed 0xD01C |
||
83 | #define PS_DPC_Aperture 0xD01D |
||
84 | #define PS_DPC_ShutterSpeed 0xD01E |
||
85 | #define PS_DPC_ExpCompensation 0xD01F |
||
86 | #define PS_DPC_FlashCompensation 0xD020 |
||
87 | #define PS_DPC_AEBExposureCompensation 0xD021 |
||
88 | #define PS_DPC_AvOpen 0xD023 |
||
89 | #define PS_DPC_AvMax 0xD024 |
||
90 | #define PS_DPC_FocalLength 0xD025 |
||
91 | #define PS_DPC_FocalLengthTele 0xD026 |
||
92 | #define PS_DPC_FocalLengthWide 0xD027 |
||
93 | #define PS_DPC_FocalLengthDenominator 0xD028 |
||
94 | #define PS_DPC_CaptureTransferMode 0xD029 |
||
95 | #define PS_DPC_Zoom 0xD02A |
||
96 | #define PS_DPC_NamePrefix 0xD02B |
||
97 | #define PS_DPC_SizeQualityMode 0xD02C |
||
98 | #define PS_DPC_SupportedThumbSize 0xD02D |
||
99 | #define PS_DPC_SizeOfOutputDataFromCamera 0xD02E |
||
100 | #define PS_DPC_SizeOfInputDataToCamera 0xD02F |
||
101 | #define PS_DPC_RemoteAPIVersion 0xD030 |
||
102 | #define PS_DPC_FirmwareVersion 0xD031 |
||
103 | #define PS_DPC_CameraModel 0xD032 |
||
104 | #define PS_DPC_CameraOwner 0xD033 |
||
105 | #define PS_DPC_UnixTime 0xD034 |
||
106 | #define PS_DPC_CameraBodyID 0xD035 |
||
107 | #define PS_DPC_CameraOutput 0xD036 |
||
108 | #define PS_DPC_DispAv 0xD037 |
||
109 | #define PS_DPC_AvOpenApex 0xD038 |
||
110 | #define PS_DPC_DZoomMagnification 0xD039 |
||
111 | #define PS_DPC_MlSpotPos 0xD03A |
||
112 | #define PS_DPC_DispAvMax 0xD03B |
||
113 | #define PS_DPC_AvMaxApex 0xD03C |
||
114 | #define PS_DPC_EZoomStartPosition 0xD03D |
||
115 | #define PS_DPC_FocalLengthOfTele 0xD03E |
||
116 | #define PS_DPC_EZoomSizeOfTele 0xD03F |
||
117 | #define PS_DPC_PhotoEffect 0xD040 |
||
118 | #define PS_DPC_AssistLight 0xD041 |
||
119 | #define PS_DPC_FlashQuantityCount 0xD042 |
||
120 | #define PS_DPC_RotationAngle 0xD043 |
||
121 | #define PS_DPC_RotationScene 0xD044 |
||
122 | #define PS_DPC_EventEmulateMode 0xD045 |
||
123 | #define PS_DPC_DPOFVersion 0xD046 |
||
124 | #define PS_DPC_TypeOfSupportedSlideShow 0xD047 |
||
125 | #define PS_DPC_AverageFilesizes 0xD048 |
||
126 | #define PS_DPC_ModelID 0xD049 |
||
127 | |||
128 | |||
129 | class PSStateHandlers : public PTPStateHandlers |
||
130 | { |
||
131 | public: |
||
132 | virtual void OnSessionOpenedState(PTP *ptp); |
||
133 | }; |
||
134 | |||
135 | |||
136 | |||
137 | class CanonPS : public PTP |
||
138 | { |
||
139 | public: |
||
140 | // ISO Speed Values |
||
141 | enum { IsoAuto = 0, Iso80 = 0x45, Iso100 = 0x48, Iso200 = 0x50, Iso400 = 0x58, Iso800=0x60 }; |
||
142 | |||
143 | // White Balance Values |
||
144 | enum { WbAuto = 0, WbSunny, WbCloudy, WbTungsten, WbFluorescent, WbFlash, WbCustom, WbUnknown }; |
||
145 | |||
146 | // Exposure Compensation Values (same values for both exposure compensation and flash compensation) |
||
147 | enum { ExpCompDown2 = 0x08, ExpCompDown1_2d3= 0x0B, ExpCompDown1_1d3= 0x0D, ExpCompDown1 = 0x10, ExpCompDown2d3 = 0x13, |
||
148 | ExpCompDown1d3 = 0x15, ExpComp_0 = 18, ExpCompUp1d3 = 0x1B, ExpCompUp2d3 = 0x1D, ExpCompUp1 = 0x20, |
||
149 | ExpCompUp1_1d3 = 0x23, ExpCompUp1_2d3 = 0x25, ExpCompUp2 = 0x28 }; |
||
150 | |||
151 | // Image Quality Values |
||
152 | enum { ImgQualityNormal = 2, ImageQualityFine = 3, ImageQualitySuperb = 5 }; |
||
153 | |||
154 | // Image Size Values |
||
155 | enum { ImgSizeLarge, ImgSizeMedium1, ImgSizeSmall, ImgSizeMedium2 }; |
||
156 | |||
157 | CanonPS(uint8_t addr, uint8_t epin, uint8_t epout, uint8_t epint, uint8_t nconf, PTPStateHandlers *s); |
||
158 | |||
159 | uint16_t Initialize(bool binit); |
||
160 | |||
161 | uint16_t Capture(); |
||
162 | uint16_t EventCheck(PTPReadParser *parser); |
||
163 | }; |
||
164 | |||
165 | #endif // __CANONPS_H__ |