Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef PRIMESENSE_H
00022 #define PRIMESENSE_H
00023
00024 #include <OniCTypes.h>
00025
00037 enum
00038 {
00039
00040 PS_PROPERTY_DUMP_DATA = 0x1d270001,
00041 PS_PROPERTY_GAIN = 0x1d270002,
00042
00043
00044 PS_PROPERTY_USB_INTERFACE = 0x1d27F001,
00045 };
00046
00055 enum
00056 {
00057
00058 PS_COMMAND_AHB_READ = 0x1d27E001,
00059 PS_COMMAND_AHB_WRITE = 0x1d27E002,
00060 PS_COMMAND_I2C_READ = 0x1d27E003,
00061 PS_COMMAND_I2C_WRITE = 0x1d27E004,
00062 PS_COMMAND_SOFT_RESET = 0x1d27E005,
00063 PS_COMMAND_POWER_RESET = 0x1d27E006,
00064 PS_COMMAND_BEGIN_FIRMWARE_UPDATE = 0x1d27E007,
00065 PS_COMMAND_END_FIRMWARE_UPDATE = 0x1d27E008,
00066 PS_COMMAND_UPLOAD_FILE = 0x1d27E009,
00067 PS_COMMAND_DOWNLOAD_FILE = 0x1d27E00A,
00068 PS_COMMAND_GET_FILE_LIST = 0x1d27E00B,
00069 PS_COMMAND_FORMAT_ZONE = 0x1d27E00C,
00070 PS_COMMAND_DUMP_ENDPOINT = 0x1d27E00D,
00071 PS_COMMAND_GET_I2C_DEVICE_LIST = 0x1d27E00E,
00072 PS_COMMAND_GET_BIST_LIST = 0x1d27E00F,
00073 PS_COMMAND_EXECUTE_BIST = 0x1d27E010,
00074 PS_COMMAND_USB_TEST = 0x1d27E011,
00075 PS_COMMAND_GET_LOG_MASK_LIST = 0x1d27E012,
00076 PS_COMMAND_SET_LOG_MASK_STATE = 0x1d27E013,
00077 PS_COMMAND_START_LOG = 0x1d27E014,
00078 PS_COMMAND_STOP_LOG = 0x1d27E015,
00079 PS_COMMAND_READ_TEMPERATURE = 0x1d27E016,
00080 PS_COMMAND_GET_TEMP_LIST = 0x1d27E017,
00081 PS_COMMAND_READ_DEBUG_DATA = 0x1d27E018,
00082 };
00083
00084 typedef enum XnUsbInterfaceType
00085 {
00086 PS_USB_INTERFACE_DONT_CARE = 0,
00087 PS_USB_INTERFACE_ISO_ENDPOINTS = 1,
00088 PS_USB_INTERFACE_BULK_ENDPOINTS = 2,
00089 } XnUsbInterfaceType;
00090
00091 #pragma pack (push, 1)
00092
00093
00094 typedef struct XnFwFileVersion
00095 {
00096 uint8_t major;
00097 uint8_t minor;
00098 uint8_t maintenance;
00099 uint8_t build;
00100 } XnFwFileVersion;
00101
00102 typedef enum XnFwFileFlags
00103 {
00104 XN_FILE_FLAG_BAD_CRC = 0x0001,
00105 } XnFwFileFlags;
00106
00107 typedef struct XnFwFileEntry
00108 {
00109 char name[32];
00110 XnFwFileVersion version;
00111 uint32_t address;
00112 uint32_t size;
00113 uint16_t crc;
00114 uint16_t zone;
00115 XnFwFileFlags flags;
00116 } XnFwFileEntry;
00117
00118 typedef struct XnI2CDeviceInfo
00119 {
00120 uint8_t masterId;
00121 uint8_t slaveId;
00122 uint32_t id;
00123 char name[32];
00124 } XnI2CDeviceInfo;
00125
00126 typedef struct XnBistInfo
00127 {
00128 uint32_t id;
00129 char name[32];
00130 } XnBistInfo;
00131
00132 typedef struct XnTempInfo
00133 {
00134 uint32_t id;
00135 char name[16];
00136 } XnTempInfo;
00137
00138 typedef struct XnFwLogMask
00139 {
00140 uint32_t id;
00141 char name[32];
00142 } XnFwLogMask;
00143
00144 typedef struct XnUsbTestEndpointResult
00145 {
00146 double averageBytesPerSecond;
00147 uint32_t lostPackets;
00148 } XnUsbTestEndpointResult;
00149
00150
00151
00152 typedef struct XnCommandAHB
00153 {
00154 uint32_t address;
00155 uint32_t offsetInBits;
00156 uint32_t widthInBits;
00157 uint32_t value;
00158 } XnCommandAHB;
00159
00160 typedef struct XnCommandI2C
00161 {
00162 uint32_t deviceID;
00163 uint32_t addressSize;
00164 uint32_t address;
00165 uint32_t valueSize;
00166 uint32_t mask;
00167 uint32_t value;
00168 } XnCommandI2C;
00169
00170 typedef struct XnCommandUploadFile
00171 {
00172 const char* filePath;
00173 uint32_t uploadToFactory;
00174 } XnCommandUploadFile;
00175
00176 typedef struct XnCommandDownloadFile
00177 {
00178 uint16_t zone;
00179 const char* firmwareFileName;
00180 const char* targetPath;
00181 } XnCommandDownloadFile;
00182
00183 typedef struct XnCommandGetFileList
00184 {
00185 uint32_t count;
00186 XnFwFileEntry* files;
00187 } XnCommandGetFileList;
00188
00189 typedef struct XnCommandFormatZone
00190 {
00191 uint8_t zone;
00192 } XnCommandFormatZone;
00193
00194 typedef struct XnCommandDumpEndpoint
00195 {
00196 uint8_t endpoint;
00197 bool enabled;
00198 } XnCommandDumpEndpoint;
00199
00200 typedef struct XnCommandGetI2CDeviceList
00201 {
00202 uint32_t count;
00203 XnI2CDeviceInfo* devices;
00204 } XnCommandGetI2CDeviceList;
00205
00206 typedef struct XnCommandGetBistList
00207 {
00208 uint32_t count;
00209 XnBistInfo* tests;
00210 } XnCommandGetBistList;
00211
00212 typedef struct XnCommandGetTempList
00213 {
00214 uint32_t count;
00215 XnTempInfo* pTempInfos;
00216 } XnCommandGetTempList;
00217
00218 typedef struct XnCommandExecuteBist
00219 {
00220 uint32_t id;
00221 uint32_t errorCode;
00222 uint32_t extraDataSize;
00223 uint8_t* extraData;
00224 } XnCommandExecuteBist;
00225
00226 typedef struct XnCommandTemperatureResponse
00227 {
00228 uint32_t id;
00229 float temperature;
00230 } XnCommandTemperatureResponse;
00231
00232 typedef struct XnCommandUsbTest
00233 {
00234 uint32_t seconds;
00235 uint32_t endpointCount;
00236 XnUsbTestEndpointResult* endpoints;
00237 } XnCommandUsbTest;
00238
00239 typedef struct XnCommandGetLogMaskList
00240 {
00241 uint32_t count;
00242 XnFwLogMask* masks;
00243 } XnCommandGetLogMaskList;
00244
00245 typedef struct XnCommandSetLogMaskState
00246 {
00247 uint32_t mask;
00248 bool enabled;
00249 } XnCommandSetLogMaskState;
00250
00251 typedef struct XnCommandDebugData
00252 {
00253 uint16_t dataID;
00254 uint16_t dataSize;
00255 uint8_t* data;
00256 } XnCommandDebugData;
00257
00258 #pragma pack (pop)
00259
00260 #endif // PRIMESENSE_H