DJI Payload SDK  1.5.3
psdk_payload_camera.h
Go to the documentation of this file.
1 /**
2  *********************************************************************
3  * @file psdk_payload_camera.h
4  * @version V1.0.0
5  * @date 2017/11/10
6  * @brief This is the header file for "psdk_payload_camera.c", defining the
7  * structures and (exported) function prototypes.
8  *
9  * @copyright (c) 2017-2018 DJI. All rights reserved.
10  *
11  * All information contained herein is, and remains, the property of DJI.
12  * The intellectual and technical concepts contained herein are proprietary
13  * to DJI and may be covered by U.S. and foreign patents, patents in process,
14  * and protected by trade secret or copyright law. Dissemination of this
15  * information, including but not limited to data and other proprietary
16  * material(s) incorporated within the information, in any form, is strictly
17  * prohibited without the express written consent of DJI.
18  *
19  * If you receive this source code without DJI’s authorization, you may not
20  * further disseminate the information, and you must immediately remove the
21  * source code and notify DJI of its removal. DJI reserves the right to pursue
22  * legal actions against you for any loss(es) or damage(s) caused by your
23  * failure to do so.
24  *
25  *********************************************************************
26  */
27 
28 /* Define to prevent recursive inclusion -------------------------------------*/
29 #ifndef PSDK_PAYLOAD_CAMERA_H
30 #define PSDK_PAYLOAD_CAMERA_H
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /* Includes ------------------------------------------------------------------*/
37 #include "psdk_upper.h"
38 #include "psdk_cmdset.h"
39 
40 /** @addtogroup PSDK
41  * @{
42  */
43 
44 /** @addtogroup PSDK_Camera
45  * @{
46  */
47 
48 /* Exported constants --------------------------------------------------------*/
49 /* Exported macros -----------------------------------------------------------*/
50 /* Exported types ------------------------------------------------------------*/
51 
52 /** @addtogroup Camera_Exported_Types
53  * @{
54  */
55 
56 /** @defgroup Camera_Callback_Related Callback Related
57  * @{
58  */
59 
60 /**
61  * @brief Function list for handling camera commands.
62  * @details This structure type is used to define a list that
63  * includes all the callback functions related camera function:
64  * 1. Camera base functions
65  * 2. Exposure metering functions
66  * 3. Focus functions
67  * 4. Zoom functions
68  */
69 typedef struct {
70  //======== Camera Base function ==========//
71  ///Set camera mode callback function.
72  void (*SetMode) (const T_PsdkCameraSetModeReq *req, T_PsdkCameraSetModeAck *ack);
73  ///Get camera mode callback function.
74  void (*GetMode) (const T_PsdkCameraGetModeReq *req, T_PsdkCameraGetModeAck *ack);
75  ///Shoot photo callback function.
76  void (*ShootPhoto) (const T_PsdkCameraShootPhotoReq *req, T_PsdkCameraShootPhotoAck *ack);
77  ///Get shoot photo state callback function.
78  void (*GetShootPhotoState) (const T_PsdkCameraGetShootPhotoStateReq *req, T_PsdkCameraGetShootPhotoStateAck *ack);
79  ///Set shoot photo mode callback function.
80  void (*SetShootPhotoMode) (const T_PsdkCameraSetShootPhotoModeReq *req, T_PsdkCameraSetShootPhotoModeAck *ack);
81  ///Get shoot photo mode callback function.
82  void (*GetShootPhotoMode) (const T_PsdkCameraGetShootPhotoModeReq *req, T_PsdkCameraGetShootPhotoModeAck *ack);
83  ///Record video callback function.
84  void (*RecordVideo) (const T_PsdkCameraRecordVideoReq *req, T_PsdkCameraRecordVideoAck *ack);
85  ///Get record video state callback function.
86  void (*GetRecordVideoState) (const T_PsdkCameraGetRecordVideoStateReq *req, T_PsdkCameraGetRecordVideoStateAck *ack);
87  ///Get SD card state callback function.
88  void (*GetSDCardState) (const T_PsdkCameraGetSDCardStateReq *req, T_PsdkCameraGetSDCardStateAck *ack);
89  ///Format SD card callback function.
90  void (*FormatSDCard) (const T_PsdkCameraFormatSDCardReq *req, T_PsdkCameraFormatSDCardAck *ack);
91  //===== End of Camera Base function =======//
92 
93  //========== Exposure Metering ============//
94  ///Specifies whether load support exposure metering.
96  ///Set metering mode callback function.
97  void (*SetMeteringMode) (const T_PsdkCameraSetMeteringModeReq *req, T_PsdkCameraSetMeteringModeAck *ack);
98  ///Get metering mode callback function.
99  void (*GetMeteringMode) (const T_PsdkCameraGetMeteringModeReq *req, T_PsdkCameraGetMeteringModeAck *ack);
100  ///Set spot metering callback function.
101  void (*SetSpotMetering) (const T_PsdkCameraSetSpotMeteringReq *req, T_PsdkCameraSetSpotMeteringAck *ack);
102  ///Get spot metering callback function.
103  void (*GetSpotMetering) (const T_PsdkCameraGetSpotMeteringReq *req, T_PsdkCameraGetSpotMeteringAck *ack);
104  //========= End of Exposure Metering ======//
105 
106  //=============== Focus ===================//
107  ///Specifies whether load support adjustable focal point.
109  ///Set focus mode callback function.
110  void (*SetFocusMode) (const T_PsdkCameraSetFocusModeReq *req, T_PsdkCameraSetFocusModeAck *ack);
111  ///Get focus mode callback function.
112  void (*GetFocusMode) (const T_PsdkCameraGetFocusModeReq *req, T_PsdkCameraGetFocusModeAck *ack);
113  ///Set focus zone callback function.
114  void (*SetFocusZone) (const T_PsdkCameraSetFocusZoneReq *req, T_PsdkCameraSetFocusZoneAck *ack);
115  ///Get focus zone callback function.
116  void (*GetFocusZone) (const T_PsdkCameraGetFocusZoneReq *req, T_PsdkCameraGetFocusZoneAck *ack);
117  ///Set focus assistant settings callback function.
118  void (*SetFocusAssistantSettings) (const T_PsdkCameraSetFocusAssistantSettingsReq *req, T_PsdkCameraSetFocusAssistantSettingsAck *ack);
119  ///Get focus assistant settings callback function.
120  void (*GetFocusAssistantSettings) (const T_PsdkCameraGetFocusAssistantSettingsReq *req, T_PsdkCameraGetFocusAssistantSettingsAck *ack);
121  ///Get focus ring value upper bound callback function.
122  void (*GetFocusRingValueUpperBound) (const T_PsdkCameraGetFocusRingValueUpperBoundReq *req, T_PsdkCameraGetFocusRingValueUpperBoundAck *ack);
123  ///Set focus ring value callback function.
124  void (*SetFocusRingValue) (const T_PsdkCameraSetFocusRingValueReq *req, T_PsdkCameraSetFocusRingValueAck *ack);
125  ///Get focus ring value callback function.
126  void (*GetFocusRingValue) (const T_PsdkCameraGetFocusRingValueReq *req, T_PsdkCameraGetFocusRingValueAck *ack);
127  //============ End of Focus ===============//
128 
129  //=============== zoom ====================//
130  ///Specifies whether load support digital zoom.
132  ///Get digital zoom specification callback function.
133  void (*GetDigitalZoomSpec) (const T_PsdkCameraGetDigitalZoomSpecReq *req, T_PsdkCameraGetDigitalZoomSpecAck *ack);
134  ///Set digital zoom factor callback function.
135  void (*SetDigitalZoomFactor) (const T_PsdkCameraSetDigitalZoomFactorReq *req, T_PsdkCameraSetDigitalZoomFactorAck *ack);
136  ///Get digital zoom factor callback function.
137  void (*GetDigitalZoomFactor) (const T_PsdkCameraGetDigitalZoomFactorReq *req, T_PsdkCameraGetDigitalZoomFactorAck *ack);
138 
139  uint8_t isOpticalZoomSupported;
140  ///Get optical zoom specification callback function.
141  void (*GetOpticalZoomSpec) (const T_PsdkCameraGetOpticalZoomSpecReq *req, T_PsdkCameraGetOpticalZoomSpecAck *ack);
142  ///Set optical zoom focal length callback function.
143  void (*SetOpticalZoomFocalLength) (const T_PsdkCameraSetOpticalZoomFocalLengthReq *req, T_PsdkCameraSetOpticalZoomFocalLengthAck *ack);
144  ///Get optical zoom focal length callback function.
145  void (*GetOpticalZoomFocalLength) (const T_PsdkCameraGetOpticalZoomFocalLengthReq *req, T_PsdkCameraGetOpticalZoomFocalLengthAck *ack);
146  ///Get optical zoom factor callback function.
147  void (*GetOpticalZoomFactor) (const T_PsdkCameraGetOpticalZoomFactorReq *req, T_PsdkCameraGetOpticalZoomFactorAck *ack);
148  ///Start continuous optical zoom callback function.
149  void (*StartContinuousOpticalZoom) (const T_PsdkCameraStartContinuousOpticalZoomReq *req, T_PsdkCameraStartContinuousOpticalZoomAck *ack);
150  ///Stop continuous optical zoom callback function.
151  void (*StopContinuousOpticalZoom) (const T_PsdkCameraStopContinuousOpticalZoomReq *req, T_PsdkCameraStopContinuousOpticalZoomAck *ack);
152  //=========== End of zoom =================//
154 
155 /**
156  * @}
157  */
158 
159 /**
160  * @}
161  */
162 
163 /* Exported variables --------------------------------------------------------*/
164 /* Exported functions --------------------------------------------------------*/
165 
166 /** @defgroup Camera_Exported_Functions Exported Functions
167  * @{
168  */
169 
170 E_PsdkStat PsdkCamera_Init(T_PsdkUpper *psdkUpper, const T_PsdkCameraHandler *cameraHandler);
171 
172 /**
173  * @}
174  */
175 
176 /* Private constants ---------------------------------------------------------*/
177 /* Private macros ------------------------------------------------------------*/
178 /* Private types -------------------------------------------------------------*/
179 /* Private variables ---------------------------------------------------------*/
180 /* Private functions ---------------------------------------------------------*/
181 
182 /**
183  * @}
184  */
185 
186 /**
187  * @}
188  */
189 
190 #ifdef __cplusplus
191 }
192 #endif
193 
194 #endif //PSDK_PAYLOAD_CAMERA_H
195 
196 /****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/
Get optical zoom fator command ack data structure.
Definition: psdk_cmdset_camera.h:650
Get optical zoom specification command request data structure.
Definition: psdk_cmdset_camera.h:591
Get focus ring value upper bound command request data structure.
Definition: psdk_cmdset_camera.h:734
Set focus assistant setting command ack data structure.
Definition: psdk_cmdset_camera.h:704
This is a structure type for defining a top-level structure for the integration of your application w...
Definition: psdk_upper.h:113
Set focus mode command ack data structure.
Definition: psdk_cmdset_camera.h:496
Get SD card parameter command request data structure.
Definition: psdk_cmdset_camera.h:372
Function list for handling camera commands.
Definition: psdk_payload_camera.h:69
uint8_t isAdjustableFocalPointSupported
Specifies whether load support adjustable focal point.
Definition: psdk_payload_camera.h:108
Get digital zoom specification command request data structure.
Definition: psdk_cmdset_camera.h:784
Get digital zone factor command ack data structure.
Definition: psdk_cmdset_camera.h:581
Get focus ring value upper bound command ack data structure.
Definition: psdk_cmdset_camera.h:741
Get focus ring value command request data structure.
Definition: psdk_cmdset_camera.h:767
Set digital zone factor command ack data structure.
Definition: psdk_cmdset_camera.h:565
Set focus ring value command request data structure.
Definition: psdk_cmdset_camera.h:751
Set shoot photo mode command request data structure.
Definition: psdk_cmdset_camera.h:297
Record video action command request data structure.
Definition: psdk_cmdset_camera.h:338
Get shoot photo mode command ack data structure.
Definition: psdk_cmdset_camera.h:324
Get focus mode command ack data structure.
Definition: psdk_cmdset_camera.h:512
Set focus assistant setting command request data structure.
Definition: psdk_cmdset_camera.h:693
Shoot photo command request data structure.
Definition: psdk_cmdset_camera.h:259
Get optical zoom focal length command ack data structure.
Definition: psdk_cmdset_camera.h:633
Start continuous optical zoom command ack data structure.
Definition: psdk_cmdset_camera.h:668
Get record video state command ack data structure.
Definition: psdk_cmdset_camera.h:361
This is the header file for "psdk_upper.c", defining the structures and (exported) function prototype...
Get shoot photo state command ack data structure.
Definition: psdk_cmdset_camera.h:282
Get digital zoom specification command ack data structure.
Definition: psdk_cmdset_camera.h:791
Get focus assistant setting command request data structure.
Definition: psdk_cmdset_camera.h:713
Get focus zone command ack data structure.
Definition: psdk_cmdset_camera.h:547
Format SD card command request data structure.
Definition: psdk_cmdset_camera.h:405
Get camera work mode command ack data structure.
Definition: psdk_cmdset_camera.h:249
Stop continuous optical zoom command ack data structure.
Definition: psdk_cmdset_camera.h:684
uint8_t isExposureMeteringSupported
Specifies whether load support exposure metering.
Definition: psdk_payload_camera.h:95
Set camera work mode command request data structure.
Definition: psdk_cmdset_camera.h:226
Stop continuous optical zoom command request data structure.
Definition: psdk_cmdset_camera.h:677
Get optical zoom fator command request data structure.
Definition: psdk_cmdset_camera.h:643
Get optical zoom specification command ack data structure.
Definition: psdk_cmdset_camera.h:598
Get optical zoom focal length command request data structure.
Definition: psdk_cmdset_camera.h:626
Get focus ring value command ack data structure.
Definition: psdk_cmdset_camera.h:774
Set focus ring value command ack data structure.
Definition: psdk_cmdset_camera.h:758
Record video action command ack data structure.
Definition: psdk_cmdset_camera.h:345
Start continuous optical zoom command request data structure.
Definition: psdk_cmdset_camera.h:660
Set focus zone command request data structure.
Definition: psdk_cmdset_camera.h:522
Get record video state command request data structure.
Definition: psdk_cmdset_camera.h:354
Set spot metering zone command ack data structure.
Definition: psdk_cmdset_camera.h:430
Get spot metering zone command ack data structure.
Definition: psdk_cmdset_camera.h:446
Shoot photo command ack data structure.
Definition: psdk_cmdset_camera.h:266
Set digital zone factor command request data structure.
Definition: psdk_cmdset_camera.h:558
Get record video state command ack data structure.
Definition: psdk_cmdset_camera.h:412
Get shoot photo mode command request data structure.
Definition: psdk_cmdset_camera.h:317
Get digital zone factor command request data structure.
Definition: psdk_cmdset_camera.h:574
Set shoot photo mode command ack data structure.
Definition: psdk_cmdset_camera.h:308
Set optical zoom focal length command ack data structure.
Definition: psdk_cmdset_camera.h:617
Get spot metering zone command request data structure.
Definition: psdk_cmdset_camera.h:439
Set spot metering zone command request data structure.
Definition: psdk_cmdset_camera.h:422
uint8_t isDigitalZoomSupported
Specifies whether load support digital zoom.
Definition: psdk_payload_camera.h:131
Get metering mode command request data structure.
Definition: psdk_cmdset_camera.h:472
Get metering mode command ack data structure.
Definition: psdk_cmdset_camera.h:479
Get focus assistant setting command ack data structure.
Definition: psdk_cmdset_camera.h:720
Set focus mode command request data structure.
Definition: psdk_cmdset_camera.h:489
Set camera work mode command ack data structure.
Definition: psdk_cmdset_camera.h:233
Get focus mode command request data structure.
Definition: psdk_cmdset_camera.h:505
Get shoot photo state command request data structure.
Definition: psdk_cmdset_camera.h:275
Get focus zone command request data structure.
Definition: psdk_cmdset_camera.h:540
Set focus zone command ack data structure.
Definition: psdk_cmdset_camera.h:531
Get camera work mode command request data structure.
Definition: psdk_cmdset_camera.h:242
Set metering mode command ack data structure.
Definition: psdk_cmdset_camera.h:463
Set metering mode command request data structure.
Definition: psdk_cmdset_camera.h:456
Get SD card parameter command ack data structure.
Definition: psdk_cmdset_camera.h:379
This file defines the PSDK command set.
Set optical zoom focal length command request data structure.
Definition: psdk_cmdset_camera.h:610